summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-07-17 00:39:32 (GMT)
committerCollin Winter <collinw@gmail.com>2007-07-17 00:39:32 (GMT)
commitdc40ae6b24c90e649112f25acfbee2ce95ef727c (patch)
treeea71728061f1957fb4449a20f0301ac23a7c0149 /Lib
parent2c8fef07f68e49ac88195b429fb7a692ee9cc5cf (diff)
downloadcpython-dc40ae6b24c90e649112f25acfbee2ce95ef727c.zip
cpython-dc40ae6b24c90e649112f25acfbee2ce95ef727c.tar.gz
cpython-dc40ae6b24c90e649112f25acfbee2ce95ef727c.tar.bz2
Fix two bugs from the map->itertools.imap switch.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/filelist.py3
-rw-r--r--Lib/distutils/version.py8
2 files changed, 5 insertions, 6 deletions
diff --git a/Lib/distutils/filelist.py b/Lib/distutils/filelist.py
index a052353..cc48e48 100644
--- a/Lib/distutils/filelist.py
+++ b/Lib/distutils/filelist.py
@@ -65,8 +65,7 @@ class FileList:
def sort (self):
# Not a strict lexical sort!
- sortable_files = map(os.path.split, self.files)
- sortable_files.sort()
+ sortable_files = sorted(map(os.path.split, self.files))
self.files = []
for sort_tuple in sortable_files:
self.files.append(os.path.join(*sort_tuple))
diff --git a/Lib/distutils/version.py b/Lib/distutils/version.py
index de20e21..96b6552 100644
--- a/Lib/distutils/version.py
+++ b/Lib/distutils/version.py
@@ -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