diff options
author | Greg Ward <gward@python.net> | 2000-02-26 00:49:40 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-02-26 00:49:40 (GMT) |
commit | 7a0620c3a5b3c906c941938158e030eb8b1c231b (patch) | |
tree | b83610ca577026f68c900d54d53dcd0529a3c4b3 /Lib | |
parent | 4f08e4facbb44b64fb1388baaa9a00c9690f8c5b (diff) | |
download | cpython-7a0620c3a5b3c906c941938158e030eb8b1c231b.zip cpython-7a0620c3a5b3c906c941938158e030eb8b1c231b.tar.gz cpython-7a0620c3a5b3c906c941938158e030eb8b1c231b.tar.bz2 |
Try to deal with pre-1.5.2 IOError exception objects.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/distutils/core.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/distutils/core.py b/Lib/distutils/core.py index ddd39a2..a92bff9 100644 --- a/Lib/distutils/core.py +++ b/Lib/distutils/core.py @@ -99,8 +99,12 @@ def setup (**attrs): except KeyboardInterrupt: raise SystemExit, "interrupted" except IOError, exc: - # is this 1.5.2-specific? 1.5-specific? - raise SystemExit, "error: %s: %s" % (exc.filename, exc.strerror) + # arg, try to work with Python pre-1.5.2 + if hasattr (exc, 'filename') and hasattr (exc, 'strerror'): + raise SystemExit, \ + "error: %s: %s" % (exc.filename, exc.strerror) + else: + raise SystemExit, str (exc) # setup () |