mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Back out conversion to string methods; the Distutils is intended to work
with 1.5.2
This commit is contained in:
parent
a7f225d88a
commit
ac20f773f3
4 changed files with 13 additions and 13 deletions
|
|
@ -112,12 +112,12 @@ class StrictVersion (Version):
|
|||
match.group(1, 2, 4, 5, 6)
|
||||
|
||||
if patch:
|
||||
self.version = tuple(map(int, [major, minor, patch]))
|
||||
self.version = tuple(map(string.atoi, [major, minor, patch]))
|
||||
else:
|
||||
self.version = tuple(map(int, [major, minor]) + [0])
|
||||
self.version = tuple(map(string.atoi, [major, minor]) + [0])
|
||||
|
||||
if prerelease:
|
||||
self.prerelease = (prerelease[0], int(prerelease_num))
|
||||
self.prerelease = (prerelease[0], string.atoi(prerelease_num))
|
||||
else:
|
||||
self.prerelease = None
|
||||
|
||||
|
|
@ -125,9 +125,9 @@ class StrictVersion (Version):
|
|||
def __str__ (self):
|
||||
|
||||
if self.version[2] == 0:
|
||||
vstring = '.'.join(map(str, self.version[0:2]))
|
||||
vstring = string.join(map(str, self.version[0:2]), '.')
|
||||
else:
|
||||
vstring = '.'.join(map(str, self.version))
|
||||
vstring = string.join(map(str, self.version), '.')
|
||||
|
||||
if self.prerelease:
|
||||
vstring = vstring + self.prerelease[0] + str(self.prerelease[1])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue