[Python-checkins] r69682 - python/branches/py3k/Lib/distutils/version.py

benjamin.peterson python-checkins at python.org
Mon Feb 16 19:22:15 CET 2009


Author: benjamin.peterson
Date: Mon Feb 16 19:22:15 2009
New Revision: 69682

Log:
remove another use of cmp()

Modified:
   python/branches/py3k/Lib/distutils/version.py

Modified: python/branches/py3k/Lib/distutils/version.py
==============================================================================
--- python/branches/py3k/Lib/distutils/version.py	(original)
+++ python/branches/py3k/Lib/distutils/version.py	Mon Feb 16 19:22:15 2009
@@ -338,7 +338,12 @@
         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


More information about the Python-checkins mailing list