From: Benjamin Peterson Date: Mon, 16 Feb 2009 18:22:15 +0000 (+0000) Subject: remove another use of cmp() X-Git-Tag: v3.1a1~164 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d67c60ff8116e6c9ac73ad8cd556573a73598b4f;p=python remove another use of cmp() --- diff --git a/Lib/distutils/version.py b/Lib/distutils/version.py index 77814377a5..79d458d847 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