mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Avoid “error: None” messages from distutils (#4931).
Thanks to Amaury Forgeot d’Arc and Philip J. Eby.
This commit is contained in:
parent
ed5d95b76b
commit
fc773a2d4b
6 changed files with 20 additions and 38 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue