We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 854780a commit cec4ce5Copy full SHA for cec4ce5
distutils/version.py
@@ -185,15 +185,11 @@ def _cmp(self, other):
185
elif not isinstance(other, StrictVersion):
186
return NotImplemented
187
188
- if self.version != other.version:
189
- # numeric versions don't match
190
- # prerelease stuff doesn't matter
191
- if self.version < other.version:
192
- return -1
193
- else:
194
- return 1
195
-
196
- return self._cmp_prerelease(other)
+ if self.version == other.version:
+ # versions match; pre-release drives the comparison
+ return self._cmp_prerelease(other)
+
+ return -1 if self.version < other.version else 1
197
198
def _cmp_prerelease(self, other):
199
"""
0 commit comments