Skip to content

Commit 4caeec4

Browse files
committed
Fix crash
1 parent 066bf21 commit 4caeec4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_asynciomodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2214,7 +2214,7 @@ leave_task(asyncio_state *state, PyObject *loop, PyObject *task)
22142214
// See the comment in `enter_task` for the explanation of why
22152215
// the following is needed.
22162216
_PyThreadStateImpl *ts = (_PyThreadStateImpl *)_PyThreadState_GET();
2217-
if (ts->asyncio_running_loop == loop) {
2217+
if (ts->asyncio_running_loop == NULL || ts->asyncio_running_loop == loop) {
22182218
Py_CLEAR(ts->asyncio_running_task);
22192219
}
22202220

0 commit comments

Comments
 (0)