Skip to content

Commit bda45c8

Browse files
committed
Filter out dead or daemon threads
1 parent a8ffeee commit bda45c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_asyncio/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ def close_loop(self, loop):
558558
else:
559559
if isinstance(watcher, asyncio.ThreadedChildWatcher):
560560
watcher._join_threads(timeout=support.SHORT_TIMEOUT)
561-
threads = watcher._threads
561+
threads = {key: thread for key, thread in watcher._threads.items()
562+
if thread.is_alive() and not thread.daemon}
562563
if threads:
563564
self.fail(f"watcher still has running threads: "
564565
f"{threads}")

0 commit comments

Comments
 (0)