Skip to content

Commit

Permalink
Use sys._is_gil_enabled()
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Oct 3, 2024
1 parent cefaed9 commit 27a2e43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

import sysconfig
import sys
import typing as t
from types import ModuleType

Expand All @@ -17,7 +17,9 @@

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


@pytest.fixture(
Expand Down

0 comments on commit 27a2e43

Please sign in to comment.