diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 870084100a1b857..3725adc41bb5326 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -434,14 +434,7 @@ future_schedule_callbacks(asyncio_state *state, FutureObj *fut) return 0; } - len = PyList_GET_SIZE(fut->fut_callbacks); - if (len == 0) { - /* The list of callbacks was empty; clear it and return. */ - Py_CLEAR(fut->fut_callbacks); - return 0; - } - - for (i = 0; i < len; i++) { + for (i = 0; i < PyList_GET_SIZE(fut->fut_callbacks); i++) { PyObject *cb_tup = PyList_GET_ITEM(fut->fut_callbacks, i); PyObject *cb = PyTuple_GET_ITEM(cb_tup, 0); PyObject *ctx = PyTuple_GET_ITEM(cb_tup, 1);