From: Greg Ward Date: Sat, 26 Feb 2000 00:49:40 +0000 (+0000) Subject: Try to deal with pre-1.5.2 IOError exception objects. X-Git-Tag: v1.6a1~346 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7a0620c3a5b3c906c941938158e030eb8b1c231b;p=thirdparty%2FPython%2Fcpython.git Try to deal with pre-1.5.2 IOError exception objects. --- diff --git a/Lib/distutils/core.py b/Lib/distutils/core.py index ddd39a2c7902..a92bff95736b 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 ()