]> granicus.if.org Git - python/commitdiff
Fix two bugs from the map->itertools.imap switch.
authorCollin Winter <collinw@gmail.com>
Tue, 17 Jul 2007 00:39:32 +0000 (00:39 +0000)
committerCollin Winter <collinw@gmail.com>
Tue, 17 Jul 2007 00:39:32 +0000 (00:39 +0000)
Lib/distutils/filelist.py
Lib/distutils/version.py

index a0523531c78a505efbf2f663e7dcccab6ed2cfe0..cc48e48e58c85fbba3d5dfb38649c13609428a25 100644 (file)
@@ -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))
index de20e21f70ed1965cb5db172a068a30c9adc6bf6..96b65521971df5d6a72189722024673747871623 100644 (file)
@@ -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