diff options
| author | Greg Ward <gward@python.net> | 2000-02-26 00:49:40 +0000 |
|---|---|---|
| committer | Greg Ward <gward@python.net> | 2000-02-26 00:49:40 +0000 |
| commit | 06c2f98eb01493396435bb99b6e0264e3888353a (patch) | |
| tree | 5730a11f6e0563693aeae6544cf02a87951dae5b | |
| parent | 0e7f7e1c36820e01bde9edbbcd9acc623445b045 (diff) | |
| download | python-setuptools-git-06c2f98eb01493396435bb99b6e0264e3888353a.tar.gz | |
Try to deal with pre-1.5.2 IOError exception objects.
| -rw-r--r-- | core.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 () |
