Ignore lingering pycares shutdown thread (#146733)

This commit is contained in:
Marc Mueller 2025-06-13 15:09:37 +02:00 committed by Franck Nijhof
parent d4ffeedc87
commit e89c3b1e92
No known key found for this signature in database
GPG Key ID: AB33ADACE7101952

View File

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