summaryrefslogtreecommitdiff
path: root/Lib/distutils/spawn.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
commitb940e113bf90ff71b0ef57414ea2beea9d2a4bc0 (patch)
tree0b9ea19eba1e665dac95126c3140ac2bc36326ad /Lib/distutils/spawn.py
parent893523e80a2003d4a630aafb84ba016e0070cbbd (diff)
downloadcpython-git-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.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/spawn.py')
-rw-r--r--Lib/distutils/spawn.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py
index e5654ff009..6b07f52ebe 100644
--- a/Lib/distutils/spawn.py
+++ b/Lib/distutils/spawn.py
@@ -78,7 +78,7 @@ def _spawn_nt (cmd,
# spawn for NT requires a full path to the .exe
try:
rc = os.spawnv(os.P_WAIT, executable, cmd)
- except OSError, exc:
+ except OSError as exc:
# this seems to happen when the command isn't found
raise DistutilsExecError, \
"command '%s' failed: %s" % (cmd[0], exc[-1])
@@ -103,7 +103,7 @@ def _spawn_os2 (cmd,
# spawnv for OS/2 EMX requires a full path to the .exe
try:
rc = os.spawnv(os.P_WAIT, executable, cmd)
- except OSError, exc:
+ except OSError as exc:
# this seems to happen when the command isn't found
raise DistutilsExecError, \
"command '%s' failed: %s" % (cmd[0], exc[-1])
@@ -131,7 +131,7 @@ def _spawn_posix (cmd,
#print "cmd[0] =", cmd[0]
#print "cmd =", cmd
exec_fn(cmd[0], cmd)
- except OSError, e:
+ except OSError as e:
sys.stderr.write("unable to execute %s: %s\n" %
(cmd[0], e.strerror))
os._exit(1)
@@ -146,7 +146,7 @@ def _spawn_posix (cmd,
while 1:
try:
(pid, status) = os.waitpid(pid, 0)
- except OSError, exc:
+ except OSError as exc:
import errno
if exc.errno == errno.EINTR:
continue