[Python-checkins] CVS: distutils/distutils dir_util.py,1.3,1.4
Greg Ward
python-dev@python.org
Fri, 16 Jun 2000 19:18:22 -0700
Update of /cvsroot/python/distutils/distutils
In directory slayer.i.sourceforge.net:/tmp/cvs-serv27970
Modified Files:
dir_util.py
Log Message:
Changed 'remove_tree()' to use the new 'grok_environment_error()' function
instead of muddling through IOError and OSError exception objects itself.
Index: dir_util.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/dir_util.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** dir_util.py 2000/06/17 01:58:14 1.3
--- dir_util.py 2000/06/17 02:18:19 1.4
***************
*** 194,200 ****
def remove_tree (directory, verbose=0, dry_run=0):
"""Recursively remove an entire directory tree. Any errors are ignored
! (apart from being reported to stdout if 'verbose' is true)."""
!
global PATH_CREATED
if verbose:
print "removing '%s' (and everything under it)" % directory
--- 194,202 ----
def remove_tree (directory, verbose=0, dry_run=0):
"""Recursively remove an entire directory tree. 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:
print "removing '%s' (and everything under it)" % directory
***************
*** 211,217 ****
except (IOError, OSError), exc:
if verbose:
! if exc.filename:
! print "error removing %s: %s (%s)" % \
! (directory, exc.strerror, exc.filename)
! else:
! print "error removing %s: %s" % (directory, exc.strerror)
--- 213,216 ----
except (IOError, OSError), exc:
if verbose:
! print grok_environment_error(
! exc, "error removing %s: " % directory)