diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 6c9e31a22c..e27ea07d5d 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -2051,7 +2051,7 @@ def threading_cleanup(*original_values): if values == original_values: break - if not count: + if count == 1: # Display a warning at the first iteration environment_altered = True dangling_threads = values[1] @@ -2068,7 +2068,8 @@ def threading_cleanup(*original_values): dangling_threads = None values = None - time.sleep(0.01) + if count: + time.sleep(0.01) gc_collect()