Commit 7aa5abea authored by Jason R. Coombs's avatar Jason R. Coombs

Replace OSError with DistutilsExecError. Fixes pypa/distutils#3 and...

Replace OSError with DistutilsExecError. Fixes pypa/distutils#3 and pypa/setuptools#2228 and bpo-41207.
parent f3b4a997
......@@ -71,9 +71,15 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
env = dict(os.environ,
MACOSX_DEPLOYMENT_TARGET=cur_target)
proc = subprocess.Popen(cmd, env=env)
proc.wait()
exitcode = proc.returncode
try:
proc = subprocess.Popen(cmd, env=env)
proc.wait()
exitcode = proc.returncode
except OSError as exc:
if not DEBUG:
cmd = cmd[0]
raise DistutilsExecError(
"command %r failed: %s" % (cmd, exc.args[-1])) from exc
if exitcode:
if not DEBUG:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment