[Distutils] install_headers,install_data
Greg Ward
gward@python.net
Tue, 20 Jun 2000 23:39:12 -0400
On 08 June 2000, Moshe Zadka said:
> Great work, but one small nit: you use try/except in two places there.
> The first just catch ValueError's, and the second can catch
> (IOError, os.error), though I'm not sure what for: if there are problems
> reading config.h, it seems we're in a pretty mess: pretending everything
> is alright won't make it so <wink>
As of a few days ago, the "correct" way to deal with IOError and
os.error is to call 'grok_environment_error()'. Eg. from core.py (well,
this is how it *should* look...):
try:
dist.run_commands ()
except KeyboardInterrupt:
raise SystemExit, "interrupted"
except EnvironmentError, exc:
error = grok_environment_error(exc)
if DEBUG:
sys.stderr.write(error + "\n")
raise
else:
raise SystemExit, error
'grok_environment_error()' makes the best of a bad situation, ie. the
number of inconsistent ways that an IOError or os.error object can exist
(sigh).
Greg
--
Greg Ward - Unix geek gward@python.net
http://starship.python.net/~gward/
I once decorated my apartment entirely in ten foot salad forks!!