]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Changed to use the new 'grok_environment_error()' function instead of
authorGreg Ward <gward@python.net>
Sat, 17 Jun 2000 02:17:45 +0000 (02:17 +0000)
committerGreg Ward <gward@python.net>
Sat, 17 Jun 2000 02:17:45 +0000 (02:17 +0000)
muddling through IOError and OSError exception objects right here.

Lib/distutils/core.py

index 8bcf2a87d694ae46efa16cf0838c7f89a11cdec7..35afa84b7e577305745f1fff723b6222e25a308c 100644 (file)
@@ -112,16 +112,7 @@ def setup (**attrs):
         except KeyboardInterrupt:
             raise SystemExit, "interrupted"
         except (IOError, os.error), exc:
-            # check for Python 1.5.2-style {IO,OS}Error exception objects
-            if hasattr (exc, 'filename') and hasattr (exc, 'strerror'):
-                if exc.filename:
-                    error = "error: %s: %s" % (exc.filename, exc.strerror)
-                else:
-                    # two-argument functions in posix module don't
-                    # include the filename in the exception object!
-                    error = "error: %s" % exc.strerror
-            else:
-                error = "error: " + str(exc[-1])
+            error = grok_environment_error(exc)
 
             if DEBUG:
                 sys.stderr.write(error + "\n")