Avoid “error: None” messages from distutils (#4931).

Thanks to Amaury Forgeot d’Arc and Philip J. Eby.
This commit is contained in:
Éric Araujo 2014-03-12 03:34:02 -04:00
parent ed5d95b76b
commit fc773a2d4b
6 changed files with 20 additions and 38 deletions

View file

@ -11,7 +11,6 @@ import sys
from distutils.debug import DEBUG
from distutils.errors import *
from distutils.util import grok_environment_error
# Mainly import these so setup scripts can "from distutils.core import" them.
from distutils.dist import Distribution
@ -149,13 +148,11 @@ def setup (**attrs):
except KeyboardInterrupt:
raise SystemExit("interrupted")
except (IOError, os.error) as exc:
error = grok_environment_error(exc)
if DEBUG:
sys.stderr.write(error + "\n")
sys.stderr.write("error: %s\n" % (exc,))
raise
else:
raise SystemExit(error)
raise SystemExit("error: %s" % (exc,))
except (DistutilsError,
CCompilerError) as msg: