aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_threading.py
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-04-11 15:00:54 -0400
committerGitHub <noreply@github.com>2024-04-11 15:00:54 -0400
commit25f6ff5d3e92305659db62e7f7545f823f0dbd05 (patch)
tree3fe6dd2136780028874b6b3cde3ca8c4c903f033 /Lib/test/test_threading.py
parent39d381f91e93559011587d764c1895ee30efb741 (diff)
downloadcpython-25f6ff5d3e92305659db62e7f7545f823f0dbd05.tar.gz
cpython-25f6ff5d3e92305659db62e7f7545f823f0dbd05.zip
gh-117649: Raise ImportError for unsupported modules in free-threaded build (#117651)
The free-threaded build does not currently support the combination of single-phase init modules and non-isolated subinterpreters. Ensure that `check_multi_interp_extensions` is always `True` for subinterpreters in the free-threaded build so that importing these modules raises an `ImportError`.
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r--Lib/test/test_threading.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index a7701fa285a..a712ed10f02 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -1527,6 +1527,7 @@ class SubinterpThreadingTests(BaseTestCase):
{before_start}
t.start()
""")
+ check_multi_interp_extensions = bool(support.Py_GIL_DISABLED)
script = textwrap.dedent(f"""
import test.support
test.support.run_in_subinterp_with_config(
@@ -1536,7 +1537,7 @@ class SubinterpThreadingTests(BaseTestCase):
allow_exec=True,
allow_threads={allowed},
allow_daemon_threads={daemon_allowed},
- check_multi_interp_extensions=False,
+ check_multi_interp_extensions={check_multi_interp_extensions},
own_gil=False,
)
""")