summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_tarfile.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index 0f3df7fa06..503de26c9a 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -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)