summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/dir_util.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2014-03-12 07:34:02 (GMT)
committerÉric Araujo <merwok@netwok.org>2014-03-12 07:34:02 (GMT)
commitfc773a2d4ba3810b982e703bf8a240206369e5d1 (patch)
tree7d1428117d5ec01e94cdba671e35755cf9462a3e /Lib/distutils/dir_util.py
parented5d95b76bd9a3584038bf578bac8f473a47e4c4 (diff)
downloadcpython-fc773a2d4ba3810b982e703bf8a240206369e5d1.zip
cpython-fc773a2d4ba3810b982e703bf8a240206369e5d1.tar.gz
cpython-fc773a2d4ba3810b982e703bf8a240206369e5d1.tar.bz2
Avoid “error: None” messages from distutils (#4931).
Thanks to Amaury Forgeot d’Arc and Philip J. Eby.
Diffstat (limited to 'Lib/distutils/dir_util.py')
-rw-r--r--Lib/distutils/dir_util.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/distutils/dir_util.py b/Lib/distutils/dir_util.py
index 2826ff8..6a72bdd 100644
--- a/Lib/distutils/dir_util.py
+++ b/Lib/distutils/dir_util.py
@@ -2,7 +2,7 @@
Utility functions for manipulating directories and directory trees."""
-import os, sys
+import os
import errno
from distutils.errors import DistutilsFileError, DistutilsInternalError
from distutils import log
@@ -182,7 +182,6 @@ def remove_tree(directory, verbose=1, dry_run=0):
Any errors are ignored (apart from being reported to stdout if 'verbose'
is true).
"""
- from distutils.util import grok_environment_error
global _path_created
if verbose >= 1:
@@ -199,8 +198,7 @@ def remove_tree(directory, verbose=1, dry_run=0):
if abspath in _path_created:
del _path_created[abspath]
except (IOError, OSError) as exc:
- log.warn(grok_environment_error(
- exc, "error removing %s: " % directory))
+ log.warn("error removing %s: %s", directory, exc)
def ensure_relative(path):
"""Take the full path 'path', and make it a relative path.