Beefed up error-handling in 'setup()' a smidge:
handle OSError and DistutilsExecError now.
This commit is contained in:
parent
a3c8bf382e
commit
89489fa15d
|
@ -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 ()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue