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

Function requires_gil_enabled

Lib/test/support/__init__.py:1016–1018  ·  view source on GitHub ↗

Decorator for skipping tests on the free-threaded build.

(msg="needs the GIL enabled")

Source from the content-addressed store, hash-verified

1014Py_GIL_DISABLED = bool(sysconfig.get_config_var('Py_GIL_DISABLED'))
1015
1016def requires_gil_enabled(msg="needs the GIL enabled"):
1017 """Decorator for skipping tests on the free-threaded build."""
1018 return unittest.skipIf(Py_GIL_DISABLED, msg)
1019
1020def expected_failure_if_gil_disabled():
1021 """Expect test failure if the GIL is disabled."""

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…