[asterisk-commits] mjordan: testsuite/asterisk/trunk r2751 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 15 10:41:35 CST 2011


Author: mjordan
Date: Tue Nov 15 10:41:33 2011
New Revision: 2751

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2751
Log:
Fix for version parsing of 10.0.0-rc candidates

Modified:
    asterisk/trunk/lib/python/asterisk/version.py

Modified: asterisk/trunk/lib/python/asterisk/version.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/version.py?view=diff&rev=2751&r1=2750&r2=2751
==============================================================================
--- asterisk/trunk/lib/python/asterisk/version.py (original)
+++ asterisk/trunk/lib/python/asterisk/version.py Tue Nov 15 10:41:33 2011
@@ -75,7 +75,10 @@
                 if self.minor is not None:
                     res += int(self.minor) * 10000
                     if self.patch is not None:
-                        res += int(self.__parse_version_patch(self.patch))
+                        if isinstance(self.patch, (int, long)):
+                            res += self.patch
+                        else:
+                            res += int(self.__parse_version_patch(self.patch))
             return res
 
     def __cmp__(self, other):
@@ -97,6 +100,9 @@
             self.major = parts[1]
         if len(parts) >= 3:
             self.minor = parts[2]
+            if "-" in self.minor:
+                self.patch = self.__parse_version_patch(self.minor)
+                self.minor = self.minor[:self.minor.find("-")]
         if len(parts) >= 4:
             self.patch = parts[3]
 




More information about the asterisk-commits mailing list