MCPcopy Create free account
hub / github.com/pybind/pybind11 / import_warns_freethreaded

Function import_warns_freethreaded

tests/test_cpp_conduit.py:14–21  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

12
13
14def import_warns_freethreaded(name):
15 if name not in sys.modules and not env.sys_is_gil_enabled():
16 with pytest.warns(
17 RuntimeWarning, match=f"has been enabled to load module '{name}'"
18 ):
19 return importlib.import_module(name)
20
21 return importlib.import_module(name)
22
23
24exo_planet_c_api = import_warns_freethreaded("exo_planet_c_api")

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected