Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a2f9989

Browse files
committed
Fix unused local variables caught by pychecker.
Fixes a bug for Solaris pkgtool (bdist_pkgtool) that would have prevented it from building subpackages.
1 parent a181ec0 commit a2f9989

6 files changed

Lines changed: 8 additions & 22 deletions

File tree

Lib/distutils/command/bdist_packager.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ def get_script (self,attr):
145145

146146

147147
def initialize_options (self):
148-
d = self.distribution
149148
self.keep_temp = 0
150149
self.control_only = 0
151150
self.no_autorelocate = 0
@@ -187,8 +186,7 @@ def finalize_options (self):
187186
self.pkg_dir = os.path.join(bdist_base, 'binary')
188187

189188
if not self.plat_name:
190-
d = self.distribution
191-
self.plat = d.get_platforms()
189+
self.plat = self.distribution.get_platforms()
192190
if self.distribution.has_ext_modules():
193191
self.plat_name = [sys.platform,]
194192
else:
@@ -237,12 +235,6 @@ def run (self):
237235

238236
log.info("installing to %s", self.pkg_dir)
239237
self.run_command('install')
240-
241-
# And make an archive relative to the root of the
242-
# pseudo-installation tree.
243-
archive_basename = "%s.%s" % (self.distribution.get_fullname(),
244-
self.plat_name)
245-
246238
if not self.keep_temp:
247239
remove_tree(self.pkg_dir, dry_run=self.dry_run)
248240

Lib/distutils/command/bdist_pkgtool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def make_package(self,root=None):
208208
else:
209209
pkg_dir = self.pkg_dir
210210

211-
install = self.reinitialize_command('install', reinit_subcommands=1)
211+
self.reinitialize_command('install', reinit_subcommands=1)
212212
# build package
213213
log.info('Building package')
214214
self.run_command('build')
@@ -275,7 +275,7 @@ def run (self):
275275
if self.subpackages:
276276
self.subpackages=string.split(self.subpackages,",")
277277
for pkg in self.subpackages:
278-
self.make_package(subpackage)
278+
self.make_package(pkg)
279279
else:
280280
self.make_package()
281281
# run()

Lib/distutils/core.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,7 @@ class found in 'cmdclass' is used in place of the default, which is
125125
try:
126126
ok = dist.parse_command_line()
127127
except DistutilsArgError, msg:
128-
script = os.path.basename(dist.script_name)
129-
raise SystemExit, \
130-
gen_usage(dist.script_name) + "\nerror: %s" % msg
128+
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
131129

132130
if DEBUG:
133131
print "options (after parsing command line):"

Lib/distutils/cygwinccompiler.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ def link (self,
213213

214214
# generate the filenames for these files
215215
def_file = os.path.join(temp_dir, dll_name + ".def")
216-
exp_file = os.path.join(temp_dir, dll_name + ".exp")
217216
lib_file = os.path.join(temp_dir, 'lib' + dll_name + ".a")
218217

219218
# Generate .def file
@@ -229,16 +228,14 @@ def link (self,
229228

230229
# dllwrap uses different options than gcc/ld
231230
if self.linker_dll == "dllwrap":
232-
extra_preargs.extend([#"--output-exp",exp_file,
233-
"--output-lib",lib_file,
234-
])
231+
extra_preargs.extend(["--output-lib", lib_file])
235232
# for dllwrap we have to use a special option
236233
extra_preargs.extend(["--def", def_file])
237234
# we use gcc/ld here and can be sure ld is >= 2.9.10
238235
else:
239236
# doesn't work: bfd_close build\...\libfoo.a: Invalid operation
240237
#extra_preargs.extend(["-Wl,--out-implib,%s" % lib_file])
241-
# for gcc/ld the def-file is specified as any other object files
238+
# for gcc/ld the def-file is specified as any object files
242239
objects.append(def_file)
243240

244241
#end: if ((export_symbols is not None) and

Lib/distutils/emxccompiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,11 @@ def link (self,
174174

175175
# generate the filenames for these files
176176
def_file = os.path.join(temp_dir, dll_name + ".def")
177-
lib_file = os.path.join(temp_dir, dll_name + ".lib")
178177

179178
# Generate .def file
180179
contents = [
181-
"LIBRARY %s INITINSTANCE TERMINSTANCE" % os.path.splitext(os.path.basename(output_filename))[0],
180+
"LIBRARY %s INITINSTANCE TERMINSTANCE" % \
181+
os.path.splitext(os.path.basename(output_filename))[0],
182182
"DATA MULTIPLE NONSHARED",
183183
"EXPORTS"]
184184
for sym in export_symbols:

Lib/distutils/sysconfig.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ def expand_makefile_vars(s, vars):
305305
while 1:
306306
m = _findvar1_rx.search(s) or _findvar2_rx.search(s)
307307
if m:
308-
name = m.group(1)
309308
(beg, end) = m.span()
310309
s = s[0:beg] + vars.get(m.group(1)) + s[end:]
311310
else:

0 commit comments

Comments
 (0)