Beefed up error-handling in 'setup()' a smidge:

handle OSError and DistutilsExecError now.
This commit is contained in:
Greg Ward 2000-03-26 21:48:43 +00:00
parent a3c8bf382e
commit 89489fa15d
1 changed files with 3 additions and 1 deletions

View File

@ -98,13 +98,15 @@ def setup (**attrs):
dist.run_commands () dist.run_commands ()
except KeyboardInterrupt: except KeyboardInterrupt:
raise SystemExit, "interrupted" raise SystemExit, "interrupted"
except IOError, exc: except (OSError, IOError), exc:
# arg, try to work with Python pre-1.5.2 # arg, try to work with Python pre-1.5.2
if hasattr (exc, 'filename') and hasattr (exc, 'strerror'): if hasattr (exc, 'filename') and hasattr (exc, 'strerror'):
raise SystemExit, \ raise SystemExit, \
"error: %s: %s" % (exc.filename, exc.strerror) "error: %s: %s" % (exc.filename, exc.strerror)
else: else:
raise SystemExit, str (exc) raise SystemExit, str (exc)
except DistutilsExecError, msg:
raise SystemExit, "error: " + str (msg)
# setup () # setup ()