MCPcopy Index your code
hub / github.com/python/cpython / run_in_subinterp

Function run_in_subinterp

Lib/test/support/__init__.py:2026–2036  ·  view source on GitHub ↗

Run code in a subinterpreter. Raise unittest.SkipTest if the tracemalloc module is enabled.

(code)

Source from the content-addressed store, hash-verified

2024
2025
2026def run_in_subinterp(code):
2027 """
2028 Run code in a subinterpreter. Raise unittest.SkipTest if the tracemalloc
2029 module is enabled.
2030 """
2031 _check_tracemalloc()
2032 try:
2033 import _testcapi
2034 except ImportError:
2035 raise unittest.SkipTest("requires _testcapi")
2036 return _testcapi.run_in_subinterp(code)
2037
2038
2039def run_in_subinterp_with_config(code, *, own_gil=None, **config):

Callers 1

_from_subinterpMethod · 0.90

Calls 1

_check_tracemallocFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…