diff options
Diffstat (limited to 'Lib/distutils/spawn.py')
-rw-r--r-- | Lib/distutils/spawn.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py index aad277b..0d1bd03 100644 --- a/Lib/distutils/spawn.py +++ b/Lib/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: |