mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Fix more exception slicing.
This commit is contained in:
parent
7357c23ee7
commit
d11b68ab08
9 changed files with 15 additions and 15 deletions
|
|
@ -139,7 +139,7 @@ def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0,
|
|||
macostools.copy(src, dst, 0, preserve_times)
|
||||
except os.error as exc:
|
||||
raise DistutilsFileError(
|
||||
"could not copy '%s' to '%s': %s" % (src, dst, exc[-1]))
|
||||
"could not copy '%s' to '%s': %s" % (src, dst, exc.args[-1]))
|
||||
|
||||
# If linking (hard or symbolic), use the appropriate system call
|
||||
# (Unix only, of course, but that's the caller's responsibility)
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue