]> granicus.if.org Git - python/commitdiff
remove another use of cmp()
authorBenjamin Peterson <benjamin@python.org>
Mon, 16 Feb 2009 18:22:15 +0000 (18:22 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 16 Feb 2009 18:22:15 +0000 (18:22 +0000)
Lib/distutils/version.py

index 77814377a5fd8f02e84be28efcfba749d29bb50c..79d458d8474c1306089aa583c5c508c1146a542e 100644 (file)
@@ -338,7 +338,12 @@ class LooseVersion (Version):
         if isinstance(other, str):
             other = LooseVersion(other)
 
-        return cmp(self.version, other.version)
+        if self.version == other.version:
+            return 0
+        if self.version < other.version:
+            return -1
+        if self.version > other.version:
+            return 1
 
 
 # end class LooseVersion