mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Fix two bugs from the map->itertools.imap switch.
This commit is contained in:
parent
2c8fef07f6
commit
dc40ae6b24
2 changed files with 5 additions and 6 deletions
|
@ -306,11 +306,11 @@ class LooseVersion (Version):
|
|||
# from the parsed tuple -- so I just store the string here for
|
||||
# use by __str__
|
||||
self.vstring = vstring
|
||||
components = filter(lambda x: x and x != '.',
|
||||
self.component_re.split(vstring))
|
||||
for i in range(len(components)):
|
||||
components = [x for x in self.component_re.split(vstring)
|
||||
if x and x != '.']
|
||||
for i, obj in enumerate(components):
|
||||
try:
|
||||
components[i] = int(components[i])
|
||||
components[i] = int(obj)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue