diff Lib/distutils/spawn.py @ 44542:d0465e782b01

Fix more exception slicing.
author Georg Brandl <georg@python.org>
date Sun, 06 Jan 2008 21:13:42 +0000
parents a6d3930b5613
children 5e4d070565e7
line wrap: on
line diff
--- a/Lib/distutils/spawn.py	Sun Jan 06 18:23:30 2008 +0000
+++ b/Lib/distutils/spawn.py	Sun Jan 06 21:13:42 2008 +0000
@@ -67,7 +67,7 @@
         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 @@
         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 @@
                 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"