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
Next Next commit
start by setting *errmsg to NULL
  • Loading branch information
vstinner committed Mar 10, 2025
commit 1c3669a9a6c7b8d730731c86901fdbe9c1557394
7 changes: 4 additions & 3 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2756,6 +2756,10 @@ static int
tstate_ensure(PyInterpreterState *interp, PyThreadState *tcur,
const char **errmsg)
{
if (errmsg) {
*errmsg = NULL;
}

int has_gil;
if (tcur == NULL) {
Comment thread
vstinner marked this conversation as resolved.
/* Create a new Python thread state for this thread */
Expand Down Expand Up @@ -2790,9 +2794,6 @@ tstate_ensure(PyInterpreterState *interp, PyThreadState *tcur,
*/
++tcur->gilstate_counter;

if (errmsg) {
*errmsg = NULL;
}
return has_gil ? PyGILState_LOCKED : PyGILState_UNLOCKED;
}

Expand Down