From b940e113bf90ff71b0ef57414ea2beea9d2a4bc0 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 10 Jan 2007 16:19:56 +0000 Subject: 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 --- Lib/distutils/bcppcompiler.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Lib/distutils/bcppcompiler.py') diff --git a/Lib/distutils/bcppcompiler.py b/Lib/distutils/bcppcompiler.py index ca524a5b88e..6968cb8f6f6 100644 --- a/Lib/distutils/bcppcompiler.py +++ b/Lib/distutils/bcppcompiler.py @@ -115,7 +115,7 @@ class BCPPCompiler(CCompiler) : # This needs to be compiled to a .res file -- do it now. try: self.spawn (["brcc32", "-fo", obj, src]) - except DistutilsExecError, msg: + except DistutilsExecError as msg: raise CompileError, msg continue # the 'for' loop @@ -139,7 +139,7 @@ class BCPPCompiler(CCompiler) : self.spawn ([self.cc] + compile_opts + pp_opts + [input_opt, output_opt] + extra_postargs + [src]) - except DistutilsExecError, msg: + except DistutilsExecError as msg: raise CompileError, msg return objects @@ -164,7 +164,7 @@ class BCPPCompiler(CCompiler) : pass # XXX what goes here? try: self.spawn ([self.lib] + lib_args) - except DistutilsExecError, msg: + except DistutilsExecError as msg: raise LibError, msg else: log.debug("skipping %s (up-to-date)", output_filename) @@ -298,7 +298,7 @@ class BCPPCompiler(CCompiler) : self.mkpath (os.path.dirname (output_filename)) try: self.spawn ([self.linker] + ld_args) - except DistutilsExecError, msg: + except DistutilsExecError as msg: raise LinkError, msg else: @@ -391,7 +391,7 @@ class BCPPCompiler(CCompiler) : self.mkpath(os.path.dirname(output_file)) try: self.spawn(pp_args) - except DistutilsExecError, msg: + except DistutilsExecError as msg: print msg raise CompileError, msg -- cgit v1.2.3