Skip to content

Commit

Permalink
Declare free-threaded support
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Sep 27, 2024
1 parent 5408006 commit 9891736
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/markupsafe/_speedups.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,12 @@ static struct PyModuleDef module_definition = {
PyMODINIT_FUNC
PyInit__speedups(void)
{
return PyModule_Create(&module_definition);
PyObject *m = PyModule_Create(&module_definition);
if (m == NULL) {
return NULL;
}
#ifdef Py_GIL_DISABLED
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
#endif
return m;
}

0 comments on commit 9891736

Please sign in to comment.