mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Try to deal with pre-1.5.2 IOError exception objects.
This commit is contained in:
parent
4f08e4facb
commit
7a0620c3a5
1 changed files with 6 additions and 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 ()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue