Ignore lingering pycares shutdown thread (#146733)

pull/146158/head
Marc Mueller 2025-06-13 15:09:37 +02:00 committed by GitHub
parent 704118b3d0
commit 10874af19a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -382,8 +382,10 @@ def verify_cleanup(
# Verify no threads where left behind.
threads = frozenset(threading.enumerate()) - threads_before
for thread in threads:
assert isinstance(thread, threading._DummyThread) or thread.name.startswith(
"waitpid-"
assert (
isinstance(thread, threading._DummyThread)
or thread.name.startswith("waitpid-")
or "_run_safe_shutdown_loop" in thread.name
)
try: