Skip to content

Commit

Permalink
Filter out dead or daemon threads
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanrossum committed Oct 14, 2023
1 parent a8ffeee commit bda45c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/test/test_asyncio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ def close_loop(self, loop):
else:
if isinstance(watcher, asyncio.ThreadedChildWatcher):
watcher._join_threads(timeout=support.SHORT_TIMEOUT)
threads = watcher._threads
threads = {key: thread for key, thread in watcher._threads.items()
if thread.is_alive() and not thread.daemon}
if threads:
self.fail(f"watcher still has running threads: "
f"{threads}")
Expand Down

0 comments on commit bda45c8

Please sign in to comment.