]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #1695862: remove old test directory that causes test_urllib failures
authorŽiga Seilnacht <ziga.seilnacht@gmail.com>
Mon, 9 Apr 2007 19:10:29 +0000 (19:10 +0000)
committerŽiga Seilnacht <ziga.seilnacht@gmail.com>
Mon, 9 Apr 2007 19:10:29 +0000 (19:10 +0000)
on Windows buildbots.  The change is a one time fix and will be removed
after a successful buildbot run.

Lib/test/test_urllib.py

index 4851742aff3cfb6e5d4d1b0de0925905f2076a9e..02f89c3756d91ba1cf962f57debc332c7628a094 100644 (file)
@@ -547,6 +547,20 @@ class Pathname_Tests(unittest.TestCase):
 
 
 def test_main():
+    # cleanup old test dir on Windows buildbots
+    old_test_path = test_support.TESTFN + ".2"
+    if os.path.isdir(old_test_path):
+        for root, dirs, files in os.walk(old_test_path, topdown=False):
+            for name in files:
+                os.remove(os.path.join(root, name))
+            for name in dirs:
+                dirname = os.path.join(root, name)
+                if not os.path.islink(dirname):
+                    os.rmdir(dirname)
+                else:
+                    os.remove(dirname)
+        os.rmdir(old_test_path)
+
     test_support.run_unittest(
         urlopen_FileTests,
         urlopen_HttpTests,