mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
SF patch 1631942 by Collin Winter:
(a) "except E, V" -> "except E as V" (b) V is now limited to a simple name (local variable) (c) V is now deleted at the end of the except block
This commit is contained in:
parent
893523e80a
commit
b940e113bf
295 changed files with 817 additions and 743 deletions
|
@ -162,7 +162,7 @@ class UnixCCompiler(CCompiler):
|
|||
self.mkpath(os.path.dirname(output_file))
|
||||
try:
|
||||
self.spawn(pp_args)
|
||||
except DistutilsExecError, msg:
|
||||
except DistutilsExecError as msg:
|
||||
raise CompileError, msg
|
||||
|
||||
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
|
||||
|
@ -172,7 +172,7 @@ class UnixCCompiler(CCompiler):
|
|||
try:
|
||||
self.spawn(compiler_so + cc_args + [src, '-o', obj] +
|
||||
extra_postargs)
|
||||
except DistutilsExecError, msg:
|
||||
except DistutilsExecError as msg:
|
||||
raise CompileError, msg
|
||||
|
||||
def create_static_lib(self, objects, output_libname,
|
||||
|
@ -196,7 +196,7 @@ class UnixCCompiler(CCompiler):
|
|||
if self.ranlib:
|
||||
try:
|
||||
self.spawn(self.ranlib + [output_filename])
|
||||
except DistutilsExecError, msg:
|
||||
except DistutilsExecError as msg:
|
||||
raise LibError, msg
|
||||
else:
|
||||
log.debug("skipping %s (up-to-date)", output_filename)
|
||||
|
@ -250,7 +250,7 @@ class UnixCCompiler(CCompiler):
|
|||
linker = _darwin_compiler_fixup(linker, ld_args)
|
||||
|
||||
self.spawn(linker + ld_args)
|
||||
except DistutilsExecError, msg:
|
||||
except DistutilsExecError as msg:
|
||||
raise LinkError, msg
|
||||
else:
|
||||
log.debug("skipping %s (up-to-date)", output_filename)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue