summaryrefslogtreecommitdiff
path: root/Lib/distutils/core.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-01-10 16:19:56 +0000
committerGuido van Rossum <guido@python.org>2007-01-10 16:19:56 +0000
commitf16bc2a26e204536d477cddceaeeb5d6d9657c9e (patch)
treed08fadf5b04b876fa35cfd64d34764cc3e4241a7 /Lib/distutils/core.py
parent6f516b70819184e9cf97cf4c6bbc8abfdea7133f (diff)
downloadcpython-f16bc2a26e204536d477cddceaeeb5d6d9657c9e.tar.gz
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
Diffstat (limited to 'Lib/distutils/core.py')
-rw-r--r--Lib/distutils/core.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/distutils/core.py b/Lib/distutils/core.py
index 85a28fe795..4dc8eb01aa 100644
--- a/Lib/distutils/core.py
+++ b/Lib/distutils/core.py
@@ -110,7 +110,7 @@ def setup (**attrs):
# (ie. everything except distclass) to initialize it
try:
_setup_distribution = dist = klass(attrs)
- except DistutilsSetupError, msg:
+ except DistutilsSetupError as msg:
if 'name' not in attrs:
raise SystemExit, "error in %s setup command: %s" % \
(attrs['name'], msg)
@@ -135,7 +135,7 @@ def setup (**attrs):
# fault, so turn them into SystemExit to suppress tracebacks.
try:
ok = dist.parse_command_line()
- except DistutilsArgError, msg:
+ except DistutilsArgError as msg:
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
if DEBUG:
@@ -151,7 +151,7 @@ def setup (**attrs):
dist.run_commands()
except KeyboardInterrupt:
raise SystemExit, "interrupted"
- except (IOError, os.error), exc:
+ except (IOError, os.error) as exc:
error = grok_environment_error(exc)
if DEBUG:
@@ -161,7 +161,7 @@ def setup (**attrs):
raise SystemExit, error
except (DistutilsError,
- CCompilerError), msg:
+ CCompilerError) as msg:
if DEBUG:
raise
else: