summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/util.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-03-29 02:53:02 (GMT)
committerGreg Ward <gward@python.net>2000-03-29 02:53:02 (GMT)
commitda4d1aef4e8f9589956ea7a1e8cf2bbb249cb0eb (patch)
treeb7844617ae7e7918be8c7316ff1bd1ec78f2bc28 /Lib/distutils/util.py
parent7c1a6d477771955e3773849ef636fceda81bb3d5 (diff)
downloadcpython-da4d1aef4e8f9589956ea7a1e8cf2bbb249cb0eb.zip
cpython-da4d1aef4e8f9589956ea7a1e8cf2bbb249cb0eb.tar.gz
cpython-da4d1aef4e8f9589956ea7a1e8cf2bbb249cb0eb.tar.bz2
Patch from Bastian Kleineidam <calvin@cs.uni-sb.de>:
make 'mkdir()' return list of directories created.
Diffstat (limited to 'Lib/distutils/util.py')
-rw-r--r--Lib/distutils/util.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
index b40373c..6351bc7 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -38,11 +38,11 @@ def mkpath (name, mode=0777, verbose=0, dry_run=0):
# we're not using a recursive algorithm)
name = os.path.normpath (name)
-
+ created_dirs = []
if os.path.isdir (name) or name == '':
- return
+ return created_dirs
if PATH_CREATED.get (name):
- return
+ return created_dirs
(head, tail) = os.path.split (name)
tails = [tail] # stack of lone dirs to create
@@ -70,11 +70,13 @@ def mkpath (name, mode=0777, verbose=0, dry_run=0):
if not dry_run:
try:
os.mkdir (head)
+ created_dirs.append(head)
except os.error, (errno, errstr):
raise DistutilsFileError, \
"could not create '%s': %s" % (head, errstr)
PATH_CREATED[head] = 1
+ return created_dirs
# mkpath ()