summaryrefslogtreecommitdiffstats
path: root/lib/python/debian_support.py
diff options
context:
space:
mode:
authorPaul Wise <pabs@debian.org>2012-02-17 01:30:57 +0000
committerPaul Wise <pabs@debian.org>2012-02-17 01:30:57 +0000
commit5d1f5d6b864629cb51e812a0de65c10d7a36aa5c (patch)
treecd0bf379f2db876dbd1a9bbbdee9272db479f8af /lib/python/debian_support.py
parent4cf72b352d38e33080d86e79377178d54028f4a3 (diff)
Fix a crash when running the update script with a newer apt_pkg
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@18465 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'lib/python/debian_support.py')
-rw-r--r--lib/python/debian_support.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/python/debian_support.py b/lib/python/debian_support.py
index 258ec47ffe..41dcb4f397 100644
--- a/lib/python/debian_support.py
+++ b/lib/python/debian_support.py
@@ -90,7 +90,10 @@ class Version:
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.

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