]> granicus.if.org Git - python/commitdiff
Try to deal with pre-1.5.2 IOError exception objects.
authorGreg Ward <gward@python.net>
Sat, 26 Feb 2000 00:49:40 +0000 (00:49 +0000)
committerGreg Ward <gward@python.net>
Sat, 26 Feb 2000 00:49:40 +0000 (00:49 +0000)
Lib/distutils/core.py

index ddd39a2c79022c9d87ec466e8ce1b2a26eb3e3ee..a92bff95736b137fb4cc0114c55b6552fb6a6cb5 100644 (file)
@@ -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 ()