aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-07-05 16:33:16 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-07-05 16:34:54 -0400
commit7aa5abeafc1e0b1b351c4c8ac7eb14c310366a46 (patch)
treedf187df57ae173b76fe4debef8bcb564df38527e
parentf3b4a9972163e6063b9d37db6352a54735955d81 (diff)
downloadexternal_python_setuptools-7aa5abeafc1e0b1b351c4c8ac7eb14c310366a46.tar.gz
external_python_setuptools-7aa5abeafc1e0b1b351c4c8ac7eb14c310366a46.tar.bz2
external_python_setuptools-7aa5abeafc1e0b1b351c4c8ac7eb14c310366a46.zip
Replace OSError with DistutilsExecError. Fixes pypa/distutils#3 and pypa/setuptools#2228 and bpo-41207.
-rw-r--r--distutils/spawn.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/distutils/spawn.py b/distutils/spawn.py
index aad277b0..0d1bd039 100644
--- a/distutils/spawn.py
+++ b/distutils/spawn.py
@@ -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: