summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_shutil.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-08-19 01:07:39 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-08-19 01:07:39 (GMT)
commite7329f47e777d75a6602418f3198589828c35fce (patch)
treeff8e347615836328b741af06e8d5d3b2e783305f /Lib/test/test_shutil.py
parent99c4c340e6bb61966643c54b4ff3db832237203a (diff)
downloadcpython-e7329f47e777d75a6602418f3198589828c35fce.zip
cpython-e7329f47e777d75a6602418f3198589828c35fce.tar.gz
cpython-e7329f47e777d75a6602418f3198589828c35fce.tar.bz2
Guard shutil._make_archive against a logger=None argument.
Backporting two lines from the 3.x tests was enough to trigger the bug. I also took the opportunity of making the logging call lazy.
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r--Lib/test/test_shutil.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index 9f9bf45..b4e5415 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -349,6 +349,8 @@ class TestShutil(unittest.TestCase):
self.write_file([tmpdir, 'sub', 'file3'], 'xxx')
tmpdir2 = self.mkdtemp()
+ # force shutil to create the directory
+ os.rmdir(tmpdir2)
unittest.skipUnless(splitdrive(tmpdir)[0] == splitdrive(tmpdir2)[0],
"source and target should be on same drive")
@@ -464,6 +466,8 @@ class TestShutil(unittest.TestCase):
self.write_file([tmpdir, 'file2'], 'xxx')
tmpdir2 = self.mkdtemp()
+ # force shutil to create the directory
+ os.rmdir(tmpdir2)
base_name = os.path.join(tmpdir2, 'archive')
_make_zipfile(base_name, tmpdir)