Skip to content

Commit 63044a0

Browse files
Use sys._is_gil_enabled()
1 parent cefaed9 commit 63044a0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
import sysconfig
3+
import sys
44
import typing as t
55
from types import ModuleType
66

@@ -17,7 +17,9 @@
1717

1818
def pytest_report_header() -> list[str]:
1919
"""Return a list of strings to be displayed in the header of the report."""
20-
return [f"Free-threaded: {bool(sysconfig.get_config_var('Py_GIL_DISABLED'))}"]
20+
if sys.version_info < (3, 13):
21+
return []
22+
return [f"Free-threaded: {sys._is_gil_enabled()}"]
2123

2224

2325
@pytest.fixture(

0 commit comments

Comments
 (0)