General cleanup, raise normalization in Lib/distutils.
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 @@
# 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 @@
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 @@
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 @@
return outputs
-# copy_tree ()
-
# Helper for remove_tree()
def _build_cmdtuple(path, cmdtuples):
for f in os.listdir(path):