summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xLib/test/regrtest.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index cac3c8c..5b1f4e2 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -688,6 +688,10 @@ def runtest_inner(test, generate, verbose, quiet, test_times,
def cleanup_test_droppings(testname, verbose):
import shutil
import stat
+ import gc
+
+ # First kill any dangling references to open files etc.
+ gc.collect()
# Try to clean up junk commonly left behind. While tests shouldn't leave
# any files or directories behind, when a test fails that can be tedious