summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorJohannes Gijsbers <jlg@dds.nl>2005-01-23 12:20:15 (GMT)
committerJohannes Gijsbers <jlg@dds.nl>2005-01-23 12:20:15 (GMT)
commit926d45bb4eb6b85b58586c027fe5e4b3467d4dc7 (patch)
treeac8d32b87084f7ee12b17edf3499bd1b806f88d2 /Lib/shutil.py
parent8e3ca8af2641a47a83f02135a77193b0b80c545e (diff)
downloadcpython-926d45bb4eb6b85b58586c027fe5e4b3467d4dc7.zip
cpython-926d45bb4eb6b85b58586c027fe5e4b3467d4dc7.tar.gz
cpython-926d45bb4eb6b85b58586c027fe5e4b3467d4dc7.tar.bz2
shutil.copytree: move copystat call for the directory after the loop
copying files inside the directory, as that loop changes the atime and mtime.
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r--Lib/shutil.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index d6e7d18..baedd4c 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -109,7 +109,6 @@ def copytree(src, dst, symlinks=False):
"""
names = os.listdir(src)
os.makedirs(dst)
- copystat(src, dst)
errors = []
for name in names:
srcname = os.path.join(src, name)
@@ -125,6 +124,7 @@ def copytree(src, dst, symlinks=False):
# XXX What about devices, sockets etc.?
except (IOError, os.error), why:
errors.append((srcname, dstname, why))
+ copystat(src, dst)
if errors:
raise Error, errors