]> granicus.if.org Git - python/commitdiff
test_directory(): Remove the leftover temp directory that's making
authorTim Peters <tim.peters@gmail.com>
Mon, 15 May 2006 21:32:25 +0000 (21:32 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 15 May 2006 21:32:25 +0000 (21:32 +0000)
the Windows buildbots fail test_tarfile.

Lib/test/test_tarfile.py

index 0f3df7fa0635e22bd7247f9c3c88da0cc0ae1c92..503de26c9a3d67c911ae351705ebbc6815ab9aba 100644 (file)
@@ -295,6 +295,10 @@ class WriteSize0Test(BaseTest):
 
     def test_directory(self):
         path = os.path.join(self.tmpdir, "directory")
+        if os.path.exists(path):
+            # This shouldn't be necessary, but is <wink> if a previous
+            # run was killed in mid-stream.
+            shutil.rmtree(path)
         os.mkdir(path)
         tarinfo = self.dst.gettarinfo(path)
         self.assertEqual(tarinfo.size, 0)