Skip to content

Commit

Permalink
style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Oct 7, 2024
1 parent b6ff4ad commit 0a00cfe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/markupsafe/_speedups.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,14 @@ PyMODINIT_FUNC
PyInit__speedups(void)
{
PyObject *m = PyModule_Create(&module_definition);

if (m == NULL) {
return NULL;
}
#ifdef Py_GIL_DISABLED

#ifdef Py_GIL_DISABLED
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
#endif
#endif

return m;
}
7 changes: 4 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@

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

return []


@pytest.fixture(
Expand Down

0 comments on commit 0a00cfe

Please sign in to comment.