summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-02-26 00:49:40 +0000
committerGreg Ward <gward@python.net>2000-02-26 00:49:40 +0000
commit06c2f98eb01493396435bb99b6e0264e3888353a (patch)
tree5730a11f6e0563693aeae6544cf02a87951dae5b
parent0e7f7e1c36820e01bde9edbbcd9acc623445b045 (diff)
downloadpython-setuptools-git-06c2f98eb01493396435bb99b6e0264e3888353a.tar.gz
Try to deal with pre-1.5.2 IOError exception objects.
-rw-r--r--core.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/core.py b/core.py
index ddd39a2c..a92bff95 100644
--- a/core.py
+++ b/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 ()