Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use PyGILState_EnsureOrFail() in _testcapi
  • Loading branch information
vstinner committed Feb 6, 2025
commit 152e2a2cba7e4270a17d67c6cbbf370544c23eeb
4 changes: 3 additions & 1 deletion Modules/_testcapimodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,9 @@ temporary_c_thread(void *data)
PyThread_release_lock(test_c_thread->start_event);

/* Allocate a Python thread state for this thread */
state = PyGILState_Ensure();
if (PyGILState_EnsureOrFail(&state) < 0) {
abort();
}

res = PyObject_CallNoArgs(test_c_thread->callback);
Py_CLEAR(test_c_thread->callback);
Expand Down