bpo-40280: Detect missing threading on WASM platforms (GH-32352)

Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
Christian Heimes 2022-04-07 10:22:47 +03:00 committed by GitHub
parent 5aee46b31b
commit 2b16a08bc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 103 additions and 21 deletions

View file

@ -20,6 +20,7 @@ from test.libregrtest.pgo import setup_pgo_tests
from test.libregrtest.utils import removepy, count, format_duration, printlist
from test import support
from test.support import os_helper
from test.support import threading_helper
# bpo-38203: Maximum delay in seconds to exit Python (call Py_Finalize()).
@ -676,7 +677,8 @@ class Regrtest:
except SystemExit as exc:
# bpo-38203: Python can hang at exit in Py_Finalize(), especially
# on threading._shutdown() call: put a timeout
faulthandler.dump_traceback_later(EXIT_TIMEOUT, exit=True)
if threading_helper.can_start_thread:
faulthandler.dump_traceback_later(EXIT_TIMEOUT, exit=True)
sys.exit(exc.code)