Skip to content
Prev Previous commit
Next Next commit
Use @requires_subinterpreters
  • Loading branch information
encukou committed Nov 20, 2025
commit 91d59e9b3985f984506a5f4b49be4f26f60479fe
5 changes: 4 additions & 1 deletion Lib/test/test_import/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import builtins
import concurrent.interpreters
import errno
import glob
import json
Expand Down Expand Up @@ -66,8 +65,10 @@
_testmultiphase = None
try:
import _interpreters
import concurrent.interpreters
except ModuleNotFoundError:
_interpreters = None
concurrent = None
try:
import _testinternalcapi
except ImportError:
Expand Down Expand Up @@ -3408,6 +3409,7 @@ def test_from_modexport(self):

self.assertEqual(module.__name__, modname)

@requires_subinterpreters
def test_from_modexport_gil_used(self):
# Test that a module with Py_MOD_GIL_USED (re-)enables the GIL.
# Do this in a new interpreter to avoid interfering with global state.
Expand Down Expand Up @@ -3461,6 +3463,7 @@ def test_from_modexport_create_nonmodule(self):
put_in_sys_modules=False)
self.assertIsInstance(module, str)

@requires_subinterpreters
def test_from_modexport_create_nonmodule_gil_used(self):
# Test that a module with Py_MOD_GIL_USED (re-)enables the GIL.
# Do this in a new interpreter to avoid interfering with global state.
Expand Down