This commit is contained in:
Éric Araujo 2014-03-12 04:10:51 -04:00
commit a0fe1f74f9
6 changed files with 20 additions and 38 deletions

View file

@ -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 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.