summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael Gilbert <michael.s.gilbert@gmail.com>2011-05-30 05:31:14 +0000
committerMichael Gilbert <michael.s.gilbert@gmail.com>2011-05-30 05:31:14 +0000
commitcc0bb87b4ac7821e5e44d05c0c27f83e50bd9bd0 (patch)
treec2b21477159ed517520a96a7d96cea7b10405a32 /lib
parent508b778c01b493b81f2f00b44844647d0907676d (diff)
correct unhandled python-apt api change
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@16733 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'lib')
-rw-r--r--lib/python/debian_support.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/python/debian_support.py b/lib/python/debian_support.py
index fc76e892ec..258ec47ffe 100644
--- a/lib/python/debian_support.py
+++ b/lib/python/debian_support.py
@@ -92,12 +92,16 @@ class Version:
def __cmp__(self, other):
return apt_pkg.VersionCompare(self.__forCompare, other.__forCompare)
-def version_compare(a, b, vc = apt_pkg.VersionCompare):
+def version_compare(a, b):
"""Compares two versions according to the Debian algorithm.
~bpo and ~volatile suffixes are ignored."""
a = _version_normalize_regexp.sub("", a)
b = _version_normalize_regexp.sub("", b)
+ try:
+ vc = apt_pkg.version_compare
+ except AttributeError:
+ vc = apt_pkg.VersionCompare
return vc(a, b)
class PackageFile:

© 2014-2024 Faster IT GmbH | imprint | privacy policy