]> granicus.if.org Git - python/commitdiff
Fix unused local variables caught by pychecker.
authorJeremy Hylton <jeremy@alum.mit.edu>
Tue, 4 Jun 2002 20:26:44 +0000 (20:26 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Tue, 4 Jun 2002 20:26:44 +0000 (20:26 +0000)
Fixes a bug for Solaris pkgtool (bdist_pkgtool) that would have
prevented it from building subpackages.

Lib/distutils/command/bdist_packager.py
Lib/distutils/command/bdist_pkgtool.py
Lib/distutils/core.py
Lib/distutils/cygwinccompiler.py
Lib/distutils/emxccompiler.py
Lib/distutils/sysconfig.py

index 11278ee28b6a9e86fe8c40fd89dc5801c7013e63..dde113ce4d7c7c6b6c3eb12aab1fbb4a4fc07717 100644 (file)
@@ -145,7 +145,6 @@ class bdist_packager (Command):
 
 
     def initialize_options (self):
-        d = self.distribution
         self.keep_temp = 0
         self.control_only = 0
         self.no_autorelocate = 0
@@ -187,8 +186,7 @@ class bdist_packager (Command):
             self.pkg_dir = os.path.join(bdist_base, 'binary')
 
         if not self.plat_name:
-            d = self.distribution
-            self.plat = d.get_platforms()
+            self.plat = self.distribution.get_platforms()
         if self.distribution.has_ext_modules():
             self.plat_name = [sys.platform,]
         else:
@@ -237,12 +235,6 @@ class bdist_packager (Command):
 
         log.info("installing to %s", self.pkg_dir)
         self.run_command('install')
-
-        # And make an archive relative to the root of the
-        # pseudo-installation tree.
-        archive_basename = "%s.%s" % (self.distribution.get_fullname(),
-                                      self.plat_name)
-
         if not self.keep_temp:
             remove_tree(self.pkg_dir, dry_run=self.dry_run)
 
index 9d6e7dc1100a63261ffbf142e3c79cf374616398..3a48d2699a3dfbf2989c4e9ba2dc12d180f9b44e 100644 (file)
@@ -208,7 +208,7 @@ class bdist_pkgtool (bdist_packager.bdist_packager):
         else:
             pkg_dir = self.pkg_dir
 
-        install = self.reinitialize_command('install', reinit_subcommands=1)
+        self.reinitialize_command('install', reinit_subcommands=1)
         # build package
         log.info('Building package')
         self.run_command('build')
@@ -275,7 +275,7 @@ class bdist_pkgtool (bdist_packager.bdist_packager):
         if self.subpackages:
             self.subpackages=string.split(self.subpackages,",")
             for pkg in self.subpackages:
-                self.make_package(subpackage)
+                self.make_package(pkg)
         else:
             self.make_package()
     # run()
index 222e6aebd8939d0bd52e6d7df3f5a63a1df73c3a..fbf5d51182473e3225831d01fbcbf82a173d878d 100644 (file)
@@ -125,9 +125,7 @@ def setup (**attrs):
     try:
         ok = dist.parse_command_line()
     except DistutilsArgError, msg:
-        script = os.path.basename(dist.script_name)
-        raise SystemExit, \
-              gen_usage(dist.script_name) + "\nerror: %s" % msg
+        raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
 
     if DEBUG:
         print "options (after parsing command line):"
index 3fb5bc9005547884240e3b22c17fd155b71b44a0..443c9bcfb70cddc65023e61ebe2155f3e5d5f617 100644 (file)
@@ -213,7 +213,6 @@ class CygwinCCompiler (UnixCCompiler):
 
             # generate the filenames for these files
             def_file = os.path.join(temp_dir, dll_name + ".def")
-            exp_file = os.path.join(temp_dir, dll_name + ".exp")
             lib_file = os.path.join(temp_dir, 'lib' + dll_name + ".a")
 
             # Generate .def file
@@ -229,16 +228,14 @@ class CygwinCCompiler (UnixCCompiler):
 
             # dllwrap uses different options than gcc/ld
             if self.linker_dll == "dllwrap":
-                extra_preargs.extend([#"--output-exp",exp_file,
-                                       "--output-lib",lib_file,
-                                     ])
+                extra_preargs.extend(["--output-lib", lib_file])
                 # for dllwrap we have to use a special option
                 extra_preargs.extend(["--def", def_file])
             # we use gcc/ld here and can be sure ld is >= 2.9.10
             else:
                 # doesn't work: bfd_close build\...\libfoo.a: Invalid operation
                 #extra_preargs.extend(["-Wl,--out-implib,%s" % lib_file])
-                # for gcc/ld the def-file is specified as any other object files
+                # for gcc/ld the def-file is specified as any object files
                 objects.append(def_file)
 
         #end: if ((export_symbols is not None) and
index 2788209c727b46854bd9a3049f6ab2761cd4e6c1..644c6fc3912b3175f2e21e665dc1ad78862001b5 100644 (file)
@@ -174,11 +174,11 @@ class EMXCCompiler (UnixCCompiler):
 
             # generate the filenames for these files
             def_file = os.path.join(temp_dir, dll_name + ".def")
-            lib_file = os.path.join(temp_dir, dll_name + ".lib")
        
             # Generate .def file
             contents = [
-                "LIBRARY %s INITINSTANCE TERMINSTANCE" % os.path.splitext(os.path.basename(output_filename))[0],
+                "LIBRARY %s INITINSTANCE TERMINSTANCE" % \
+                os.path.splitext(os.path.basename(output_filename))[0],
                 "DATA MULTIPLE NONSHARED",
                 "EXPORTS"]
             for sym in export_symbols:
index 3e323533b6e80a2adf7b0267bf380382abd8044e..847b87240bc867ee209ed6fee9624bd5747709dc 100644 (file)
@@ -305,7 +305,6 @@ def expand_makefile_vars(s, vars):
     while 1:
         m = _findvar1_rx.search(s) or _findvar2_rx.search(s)
         if m:
-            name = m.group(1)
             (beg, end) = m.span()
             s = s[0:beg] + vars.get(m.group(1)) + s[end:]
         else: