diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-14 20:08:55 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-14 20:08:55 (GMT) |
commit | 7f6423a0b42a53cba4879aa97dd3702811b86278 (patch) | |
tree | f598a1fdbca1922a3546f008559d3d1d00b2f92b /Lib/test | |
parent | 203406c3681cd0bfe53f44f2d731d05d8d71cd57 (diff) | |
download | cpython-7f6423a0b42a53cba4879aa97dd3702811b86278.zip cpython-7f6423a0b42a53cba4879aa97dd3702811b86278.tar.gz cpython-7f6423a0b42a53cba4879aa97dd3702811b86278.tar.bz2 |
test/support.py: remove TESTFN if it is a directory
Because of my previous commit (r81171), test_os failed without removing TESTFN
directory (shutil.rmtree() was broken). Some buildbots still have a @test
directory and some tests fail because of that.
The bug is reproductible with:
mkdir @test
touch @test/abc
./python Lib/test/regrtest.py test_site
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/support.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py index 08828a8..e3a3b38 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -365,6 +365,10 @@ else: 'Unicode filename tests may not be effective' % TESTFN_UNICODE_UNENCODEABLE) +if os.path.isdir(TESTFN): + # a test failed (eg. test_os) without removing TESTFN directory + shutil.rmtree(TESTFN) + # Make sure we can write to TESTFN, try in /tmp if we can't fp = None try: |