summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/dir_util.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-30 03:52:21 (GMT)
committerCollin Winter <collinw@gmail.com>2007-08-30 03:52:21 (GMT)
commit5b7e9d76f39dbf63573519c178835f72e5a5027a (patch)
tree96b04b9d52d875c9f39d148d88efeafb5184fd35 /Lib/distutils/dir_util.py
parenta73bfee73da519a508e7d95bc55c1984ae7089bd (diff)
downloadcpython-5b7e9d76f39dbf63573519c178835f72e5a5027a.zip
cpython-5b7e9d76f39dbf63573519c178835f72e5a5027a.tar.gz
cpython-5b7e9d76f39dbf63573519c178835f72e5a5027a.tar.bz2
General cleanup, raise normalization in Lib/distutils.
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):