summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/test_util.py
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-04-11 19:00:54 (GMT)
committerGitHub <noreply@github.com>2024-04-11 19:00:54 (GMT)
commit25f6ff5d3e92305659db62e7f7545f823f0dbd05 (patch)
tree3fe6dd2136780028874b6b3cde3ca8c4c903f033 /Lib/test/test_importlib/test_util.py
parent39d381f91e93559011587d764c1895ee30efb741 (diff)
downloadcpython-25f6ff5d3e92305659db62e7f7545f823f0dbd05.zip
cpython-25f6ff5d3e92305659db62e7f7545f823f0dbd05.tar.gz
cpython-25f6ff5d3e92305659db62e7f7545f823f0dbd05.tar.bz2
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_importlib/test_util.py')
-rw-r--r--Lib/test/test_importlib/test_util.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_util.py b/Lib/test/test_importlib/test_util.py
index 115cb7a..f0583c5 100644
--- a/Lib/test/test_importlib/test_util.py
+++ b/Lib/test/test_importlib/test_util.py
@@ -682,6 +682,9 @@ class IncompatibleExtensionModuleRestrictionsTests(unittest.TestCase):
raise ImportError(excsnap.msg)
@unittest.skipIf(_testsinglephase is None, "test requires _testsinglephase module")
+ # gh-117649: single-phase init modules are not currently supported in
+ # subinterpreters in the free-threaded build
+ @support.expected_failure_if_gil_disabled()
def test_single_phase_init_module(self):
script = textwrap.dedent('''
from importlib.util import _incompatible_extension_module_restrictions
@@ -706,6 +709,7 @@ class IncompatibleExtensionModuleRestrictionsTests(unittest.TestCase):
self.run_with_own_gil(script)
@unittest.skipIf(_testmultiphase is None, "test requires _testmultiphase module")
+ @support.requires_gil_enabled("gh-117649: not supported in free-threaded build")
def test_incomplete_multi_phase_init_module(self):
# Apple extensions must be distributed as frameworks. This requires
# a specialist loader.