summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-01-20 22:36:22 -0500
committerBen Gamari <ben@smart-cactus.org>2019-02-20 14:28:54 -0500
commitb9b02b70a4abad29646490c79db141434f757256 (patch)
tree47297db30cec16f60676c97bf35b945e1a17645d
parentfff13068b9a1829036cf64d69153f0290e7368d4 (diff)
downloadhaskell-b9b02b70a4abad29646490c79db141434f757256.tar.gz
testsuite: Remove directories that already exist when seeding extra_files
Otherwise the testsuite driver crashes when run multiple times with CLEANUP=NO on a test containing such extra_files.
-rw-r--r--testsuite/driver/testlib.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index ba4f6a5a47..4a87f0a117 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -882,6 +882,8 @@ def do_test(name, way, func, args, files):
if os.path.isfile(src):
link_or_copy_file(src, dst)
elif os.path.isdir(src):
+ if os.path.exists(dst):
+ shutil.rmtree(dst)
os.mkdir(dst)
lndir(src, dst)
else: