diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-02-16 18:22:15 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-02-16 18:22:15 (GMT) |
commit | d67c60ff8116e6c9ac73ad8cd556573a73598b4f (patch) | |
tree | 9a2e3ad5d5216d3a553b855b223cbc7b256bcbf8 /Lib/distutils | |
parent | 821d0f8b1f7666d1bc85ffdc8ca9cd4a64eaec17 (diff) | |
download | cpython-d67c60ff8116e6c9ac73ad8cd556573a73598b4f.zip cpython-d67c60ff8116e6c9ac73ad8cd556573a73598b4f.tar.gz cpython-d67c60ff8116e6c9ac73ad8cd556573a73598b4f.tar.bz2 |
remove another use of cmp()
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/version.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/distutils/version.py b/Lib/distutils/version.py index 7781437..79d458d 100644 --- a/Lib/distutils/version.py +++ b/Lib/distutils/version.py @@ -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 |