File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -36,16 +36,22 @@ def threading_cleanup(*original_values):
36
36
if not count :
37
37
# Display a warning at the first iteration
38
38
support .environment_altered = True
39
- dangling_threads = values [1 ]
39
+
40
+ # Copy the thread list to get a consistent output between the
41
+ # warning and the "Dangling thread" listing.
42
+ dangling_threads = list (values [1 ])
43
+
40
44
support .print_warning (f"threading_cleanup() failed to cleanup "
41
45
f"{ values [0 ] - original_values [0 ]} threads "
42
46
f"(count: { values [0 ]} , "
43
47
f"dangling: { len (dangling_threads )} )" )
44
48
for thread in dangling_threads :
45
49
support .print_warning (f"Dangling thread: { thread !r} " )
46
50
47
- # Don't hold references to threads
51
+ # Break any potential reference cycle
48
52
dangling_threads = None
53
+
54
+ # Break any potential reference cycle
49
55
values = None
50
56
51
57
time .sleep (0.01 )
You can’t perform that action at this time.
0 commit comments