Skip to content

Commit 91d59e9

Browse files
committed
Use @requires_subinterpreters
1 parent 103f427 commit 91d59e9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/test/test_import/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import builtins
2-
import concurrent.interpreters
32
import errno
43
import glob
54
import json
@@ -66,8 +65,10 @@
6665
_testmultiphase = None
6766
try:
6867
import _interpreters
68+
import concurrent.interpreters
6969
except ModuleNotFoundError:
7070
_interpreters = None
71+
concurrent = None
7172
try:
7273
import _testinternalcapi
7374
except ImportError:
@@ -3408,6 +3409,7 @@ def test_from_modexport(self):
34083409

34093410
self.assertEqual(module.__name__, modname)
34103411

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

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

0 commit comments

Comments
 (0)