diff options
author | Christian Heimes <christian@cheimes.de> | 2007-11-20 01:45:17 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-11-20 01:45:17 (GMT) |
commit | 94140157445c602566af2220f85f7483813ff9dc (patch) | |
tree | 0ae183cefcc6036ce289786efc2bd616bf62511a | |
parent | 10c476db2ca3052d537553c38881e5ceefdab9df (diff) | |
download | cpython-94140157445c602566af2220f85f7483813ff9dc.zip cpython-94140157445c602566af2220f85f7483813ff9dc.tar.gz cpython-94140157445c602566af2220f85f7483813ff9dc.tar.bz2 |
Fixed bug #1470
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.
-rw-r--r-- | Lib/test/test_shutil.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index da71fa8..56e928e 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -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"): |