Skip to content

Commit 5222bb6

Browse files
add comment
1 parent 5801138 commit 5222bb6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Modules/_asynciomodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3723,7 +3723,9 @@ module_clear(PyObject *mod)
37233723
Py_CLEAR(state->iscoroutine_typecache);
37243724

37253725
Py_CLEAR(state->context_kwname);
3726-
3726+
// Clear the ref to running loop so that finalizers can run early.
3727+
// If there are other running loops in different threads,
3728+
// those get cleared in PyThreadState_Clear later.
37273729
_PyThreadStateImpl *ts = (_PyThreadStateImpl *)_PyThreadState_GET();
37283730
Py_CLEAR(ts->asyncio_running_loop);
37293731

0 commit comments

Comments
 (0)