← Back to DAGDA | Support | Source: https://github.com/pypa/distutils/commit/7aa5abeafc1e0b1b351c4c8ac7eb14c310366a46
Skip to content

Commit 7aa5abe

Browse files
committed
Replace OSError with DistutilsExecError. Fixes #3 and pypa/setuptools#2228 and bpo-41207.
1 parent f3b4a99 commit 7aa5abe

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎distutils/spawn.py‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,15 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
7171
env = dict(os.environ,
7272
MACOSX_DEPLOYMENT_TARGET=cur_target)
7373

74-
proc = subprocess.Popen(cmd, env=env)
75-
proc.wait()
76-
exitcode = proc.returncode
74+
try:
75+
proc = subprocess.Popen(cmd, env=env)
76+
proc.wait()
77+
exitcode = proc.returncode
78+
except OSError as exc:
79+
if not DEBUG:
80+
cmd = cmd[0]
81+
raise DistutilsExecError(
82+
"command %r failed: %s" % (cmd, exc.args[-1])) from exc
7783

7884
if exitcode:
7985
if not DEBUG:

0 commit comments

Comments
 (0)