summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/dir_util.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils/dir_util.py')
-rw-r--r--Lib/distutils/dir_util.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/Lib/distutils/dir_util.py b/Lib/distutils/dir_util.py
index 7dc1205..30e352d 100644
--- a/Lib/distutils/dir_util.py
+++ b/Lib/distutils/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):