aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_threading.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r--Lib/test/test_threading.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 4414d2bb9cd..84a94647781 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -959,6 +959,7 @@ class ThreadTests(BaseTestCase):
@cpython_only
def test_frame_tstate_tracing(self):
+ _testcapi = import_module("_testcapi")
# Issue #14432: Crash when a generator is created in a C thread that is
# destroyed while the generator is still used. The issue was that a
# generator contains a frame, and the frame kept a reference to the
@@ -986,7 +987,6 @@ class ThreadTests(BaseTestCase):
threading.settrace(noop_trace)
# Create a generator in a C thread which exits after the call
- import _testcapi
_testcapi.call_in_temporary_c_thread(callback)
# Call the generator in a different Python thread, check that the
@@ -1490,6 +1490,7 @@ class SubinterpThreadingTests(BaseTestCase):
@cpython_only
def test_daemon_threads_fatal_error(self):
+ import_module("_testcapi")
subinterp_code = f"""if 1:
import os
import threading
@@ -1516,6 +1517,7 @@ class SubinterpThreadingTests(BaseTestCase):
daemon_allowed=True,
daemon=False,
):
+ import_module("_testinternalcapi")
subinterp_code = textwrap.dedent(f"""
import test.support
import threading