py3k unit tests are removing %TEMP% dir on Windows
os.removedirs removes all parent directories until it hits a non empty directory. In my case my %TEMP% directory was clean and empty.
This commit is contained in:
Christian Heimes 2007-11-20 01:45:17 +00:00
parent 10c476db2c
commit 9414015744

View file

@ -113,12 +113,9 @@ class TestShutil(unittest.TestCase):
):
if os.path.exists(path):
os.remove(path)
for path in (
os.path.join(src_dir, 'test_dir'),
os.path.join(dst_dir, 'test_dir'),
):
for path in (src_dir, os.path.join(dst_dir, os.path.pardir)):
if os.path.exists(path):
os.removedirs(path)
shutil.rmtree(path)
if hasattr(os, "symlink"):