summaryrefslogtreecommitdiff
path: root/distutils2/util.py
diff options
context:
space:
mode:
authorKelsey Hightower <kelsey.hightower@gmail.com>2011-02-10 21:37:08 -0500
committerKelsey Hightower <kelsey.hightower@gmail.com>2011-02-10 21:37:08 -0500
commitffe241d9c88caf6da7949d22cef78b86ed9a2544 (patch)
tree5f8bd40a60c6bf168bed2638c438d8378e7cb29f /distutils2/util.py
parent18e1f92438495a791b1e65ed8d3b3fb7c88a39ff (diff)
downloaddisutils2-ffe241d9c88caf6da7949d22cef78b86ed9a2544.tar.gz
Refactoring -- Removing grok_environment_error.
Diffstat (limited to 'distutils2/util.py')
-rw-r--r--distutils2/util.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/distutils2/util.py b/distutils2/util.py
index 8006213..82bb9d1 100644
--- a/distutils2/util.py
+++ b/distutils2/util.py
@@ -177,29 +177,6 @@ def subst_vars(s, local_vars):
raise ValueError("invalid variable '$%s'" % var)
-def grok_environment_error(exc, prefix="error: "):
- """Generate a useful error message from an EnvironmentError.
-
- This will generate an IOError or an OSError exception object.
- Handles Python 1.5.1 and 1.5.2 styles, and
- does what it can to deal with exception objects that don't have a
- filename (which happens when the error is due to a two-file operation,
- such as 'rename()' or 'link()'. Returns the error message as a string
- prefixed with 'prefix'.
- """
- # check for Python 1.5.2-style {IO,OS}Error exception objects
- if hasattr(exc, 'filename') and hasattr(exc, 'strerror'):
- if exc.filename:
- error = prefix + "%s: %s" % (exc.filename, exc.strerror)
- else:
- # two-argument functions in posix module don't
- # include the filename in the exception object!
- error = prefix + "%s" % exc.strerror
- else:
- error = prefix + str(exc[-1])
-
- return error
-
# Needed by 'split_quoted()'
_wordchars_re = _squote_re = _dquote_re = None