Skip to content

Commit

Permalink
Use _PyEval_IsGILEnabled() in _is_gil_enabled()
Browse files Browse the repository at this point in the history
  • Loading branch information
swtaarrs committed May 3, 2024
1 parent 637c3e5 commit fecf4bd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2404,8 +2404,7 @@ sys__is_gil_enabled_impl(PyObject *module)
/*[clinic end generated code: output=57732cf53f5b9120 input=7e9c47f15a00e809]*/
{
#ifdef Py_GIL_DISABLED
PyInterpreterState *interp = _PyInterpreterState_GET();
return interp->ceval.gil->enabled;
return _PyEval_IsGILEnabled(_PyThreadState_GET());
#else
return 1;
#endif
Expand Down

0 comments on commit fecf4bd

Please sign in to comment.