aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-01-06 21:13:42 +0000
committerGeorg Brandl <georg@python.org>2008-01-06 21:13:42 +0000
commitd11b68ab0834be4be76fca479cd4426eb45dfaec (patch)
treebc05f1c9ac1e0460d2f30531fcb31ab09084979e /Lib/distutils/spawn.py
parentFix exception slicing. (diff)
downloadcpython-d11b68ab0834be4be76fca479cd4426eb45dfaec.tar.gz
cpython-d11b68ab0834be4be76fca479cd4426eb45dfaec.tar.bz2
cpython-d11b68ab0834be4be76fca479cd4426eb45dfaec.zip
Fix more exception slicing.
Diffstat (limited to 'Lib/distutils/spawn.py')
-rw-r--r--Lib/distutils/spawn.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py
index 0aee2bc3eb4..4c536d28af7 100644
--- a/Lib/distutils/spawn.py
+++ b/Lib/distutils/spawn.py
@@ -67,7 +67,7 @@ def _spawn_nt(cmd, search_path=1, verbose=0, dry_run=0):
except OSError as exc:
# this seems to happen when the command isn't found
raise DistutilsExecError(
- "command '%s' failed: %s" % (cmd[0], exc[-1]))
+ "command '%s' failed: %s" % (cmd[0], exc.args[-1]))
if rc != 0:
# and this reflects the command running but failing
raise DistutilsExecError(
@@ -88,7 +88,7 @@ def _spawn_os2(cmd, search_path=1, verbose=0, dry_run=0):
except OSError as exc:
# this seems to happen when the command isn't found
raise DistutilsExecError(
- "command '%s' failed: %s" % (cmd[0], exc[-1]))
+ "command '%s' failed: %s" % (cmd[0], exc.args[-1]))
if rc != 0:
# and this reflects the command running but failing
print("command '%s' failed with exit status %d" % (cmd[0], rc))
@@ -124,7 +124,7 @@ def _spawn_posix(cmd, search_path=1, verbose=0, dry_run=0):
if exc.errno == errno.EINTR:
continue
raise DistutilsExecError(
- "command '%s' failed: %s" % (cmd[0], exc[-1]))
+ "command '%s' failed: %s" % (cmd[0], exc.args[-1]))
if os.WIFSIGNALED(status):
raise DistutilsExecError(
"command '%s' terminated by signal %d"