diff options
| author | Collin Winter <collinw@gmail.com> | 2007-08-30 03:52:21 +0000 |
|---|---|---|
| committer | Collin Winter <collinw@gmail.com> | 2007-08-30 03:52:21 +0000 |
| commit | aabf8bf21c444cfae978e92e626ba7c0274a9f10 (patch) | |
| tree | a1e5042dec59dedced3c7d9e9e438a683ff23161 /dir_util.py | |
| parent | 767edf21398f72156adcea6a418eba9150d06a20 (diff) | |
| download | python-setuptools-git-aabf8bf21c444cfae978e92e626ba7c0274a9f10.tar.gz | |
General cleanup, raise normalization in Lib/distutils.
Diffstat (limited to 'dir_util.py')
| -rw-r--r-- | dir_util.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/dir_util.py b/dir_util.py index 7dc1205c..30e352db 100644 --- a/dir_util.py +++ b/dir_util.py @@ -2,12 +2,9 @@ Utility functions for manipulating directories and directory trees.""" -# This module should be kept compatible with Python 2.1. - __revision__ = "$Id$" import os, sys -from types import * from distutils.errors import DistutilsFileError, DistutilsInternalError from distutils import log @@ -32,8 +29,8 @@ def mkpath (name, mode=0o777, verbose=0, dry_run=0): # Detect a common bug -- name is None if not isinstance(name, basestring): - raise DistutilsInternalError, \ - "mkpath: 'name' must be a string (got %r)" % (name,) + raise DistutilsInternalError( + "mkpath: 'name' must be a string (got %r)" % (name,)) # XXX what's the better way to handle verbosity? print as we create # each directory in the path (the current behaviour), or only announce @@ -136,8 +133,8 @@ def copy_tree (src, dst, from distutils.file_util import copy_file if not dry_run and not os.path.isdir(src): - raise DistutilsFileError, \ - "cannot copy tree '%s': not a directory" % src + raise DistutilsFileError( + "cannot copy tree '%s': not a directory" % src) try: names = os.listdir(src) except os.error as e: @@ -145,8 +142,8 @@ def copy_tree (src, dst, if dry_run: names = [] else: - raise DistutilsFileError, \ - "error listing files in '%s': %s" % (src, errstr) + raise DistutilsFileError( + "error listing files in '%s': %s" % (src, errstr)) if not dry_run: mkpath(dst) @@ -176,8 +173,6 @@ def copy_tree (src, dst, return outputs -# copy_tree () - # Helper for remove_tree() def _build_cmdtuple(path, cmdtuples): for f in os.listdir(path): |
