Skip to content

Commit 14d9c6b

Browse files
committedDec 19, 2022
add comment & remove stray decref
1 parent 34f2d3e commit 14d9c6b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎Modules/_asynciomodule.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,10 @@ set_running_loop(asyncio_state *state, PyObject *loop)
316316
if (PyDict_SetItem(
317317
ts_dict, &_Py_ID(__asyncio_running_event_loop__), loop) < 0)
318318
{
319-
Py_DECREF(loop);
320319
return -1;
321320
}
322321

323-
state->cached_running_loop = loop;
322+
state->cached_running_loop = loop; // borrowed, kept alive by ts_dict
324323
state->cached_running_loop_tsid = PyThreadState_GetID(tstate);
325324

326325
return 0;

0 commit comments

Comments
 (0)