Commit 9449a2fa authored by Greg Ward's avatar Greg Ward

Catch failure to open installed Makefile, and report it as a

DistutilsPlatformError: "invalid Python installation".  (This will
happen on Red Hat-ish systems where the python-devel package is not
installed.)
parent a5620289
......@@ -229,7 +229,17 @@ def _init_posix():
"""Initialize the module as appropriate for POSIX systems."""
g = globals()
# load the installed Makefile:
parse_makefile(open(get_makefile_filename()), g)
try:
filename = get_makefile_filename()
file = open(filename)
except IOError, msg:
my_msg = "invalid Python installation: unable to open %s" % filename
if hasattr(msg, "strerror"):
my_msg = my_msg + " (%s)" % msg.strerror
raise DistutilsPlatformError, my_msg
parse_makefile(file, g)
def _init_nt():
......
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