[Secure-testing-commits] r18465 - lib/python

Paul Wise pabs at alioth.debian.org
Fri Feb 17 01:30:58 UTC 2012


Author: pabs
Date: 2012-02-17 01:30:57 +0000 (Fri, 17 Feb 2012)
New Revision: 18465

Modified:
   lib/python/debian_support.py
Log:
Fix a crash when running the update script with a newer apt_pkg

Modified: lib/python/debian_support.py
===================================================================
--- lib/python/debian_support.py	2012-02-17 01:01:07 UTC (rev 18464)
+++ lib/python/debian_support.py	2012-02-17 01:30:57 UTC (rev 18465)
@@ -90,7 +90,10 @@
         return 'Version(%s)' % `self.__asString`
 
     def __cmp__(self, other):
-        return apt_pkg.VersionCompare(self.__forCompare, other.__forCompare)
+        try:
+            return apt_pkg.version_compare(self.__forCompare, other.__forCompare)
+        except AttributeError:
+            return apt_pkg.VersionCompare(self.__forCompare, other.__forCompare)
 
 def version_compare(a, b):
     """Compares two versions according to the Debian algorithm.




More information about the Secure-testing-commits mailing list