[Python-checkins] distutils2: Fix one bug and address some pyflakes warnings

tarek.ziade python-checkins at python.org
Sat Nov 6 22:56:14 CET 2010


tarek.ziade pushed cc5cd7736b67 to distutils2:

http://hg.python.org/distutils2/rev/cc5cd7736b67
changeset:   793:cc5cd7736b67
parent:      770:dcd2f13f6053
user:        ?ric Araujo <merwok at netwok.org>
date:        Sat Oct 16 15:58:19 2010 +0200
summary:     Fix one bug and address some pyflakes warnings
files:       distutils2/dist.py, distutils2/install.py, distutils2/util.py

diff --git a/distutils2/dist.py b/distutils2/dist.py
--- a/distutils2/dist.py
+++ b/distutils2/dist.py
@@ -406,9 +406,6 @@
         list if there are no more commands on the command line.  Returns
         None if the user asked for help on this command.
         """
-        # late import because of mutual dependence between these modules
-        from distutils2.command.cmd import Command
-
         # Pull the current command from the head of the command line
         command = args[0]
         if not command_re.match(command):
@@ -659,7 +656,7 @@
                 description = cls.description
             except AttributeError:
                 description = "(no description available)"
-            rv.append((cmd, description))
+            rv.append((cls, description))
         return rv
 
     # -- Command class/object methods ----------------------------------
diff --git a/distutils2/install.py b/distutils2/install.py
--- a/distutils2/install.py
+++ b/distutils2/install.py
@@ -63,13 +63,14 @@
     # Get all the releases that match the requirements
     try:
         releases = index.get_releases(requirements)
-    except (ReleaseNotFound, ProjectNotFound), e:
+    except (ReleaseNotFound, ProjectNotFound):
         raise InstallationException('Release not found: "%s"' % requirements)
 
     # Pick up a release, and try to get the dependency tree
     release = releases.get_last(requirements, prefer_final=prefer_final)
 
     # Iter since we found something without conflicts
+    # XXX the metadata object is not used, remove the call or the binding
     metadata = release.fetch_metadata()
 
     # Get the distributions already_installed on the system
diff --git a/distutils2/util.py b/distutils2/util.py
--- a/distutils2/util.py
+++ b/distutils2/util.py
@@ -643,7 +643,7 @@
     """
     parts = name.split('.')
     cursor = len(parts)
-    module_name, rest = parts[:cursor], parts[cursor:]
+    module_name = parts[:cursor]
 
     while cursor > 0:
         try:
@@ -654,7 +654,6 @@
                 raise
             cursor -= 1
             module_name = parts[:cursor]
-            rest = parts[cursor:]
             ret = ''
 
     for part in parts[1:]:
@@ -735,7 +734,7 @@
             else:
                 try:
                     fp = tar.extractfile(member)
-                except (KeyError, AttributeError), e:
+                except (KeyError, AttributeError):
                     # Some corrupt tar files seem to produce this
                     # (specifically bad symlinks)
                     continue

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list