Skip to content

Commit

Permalink
clear running loop early
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraditya303 committed Dec 16, 2024
1 parent 4937ba5 commit 1ad2089
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Modules/_asynciomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3724,6 +3724,9 @@ module_clear(PyObject *mod)

Py_CLEAR(state->context_kwname);

_PyThreadStateImpl *ts = (_PyThreadStateImpl *)_PyThreadState_GET();
Py_CLEAR(ts->asyncio_running_loop);

return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1667,8 +1667,6 @@ PyThreadState_Clear(PyThreadState *tstate)
Py_CLEAR(tstate->threading_local_key);
Py_CLEAR(tstate->threading_local_sentinel);

Py_CLEAR(((_PyThreadStateImpl *)tstate)->asyncio_running_loop);

Py_CLEAR(tstate->dict);
Py_CLEAR(tstate->async_exc);

Expand Down

0 comments on commit 1ad2089

Please sign in to comment.