mirror of https://github.com/python/cpython
bpo-31861: Fix reference leak in builtin_anext_impl() (GH-25008)
This commit is contained in:
parent
8370e07e1e
commit
a02683ac38
|
@ -1660,7 +1660,10 @@ builtin_anext_impl(PyObject *module, PyObject *aiterator,
|
|||
return awaitable;
|
||||
}
|
||||
|
||||
return PyAnextAwaitable_New(awaitable, default_value);
|
||||
PyObject* new_awaitable = PyAnextAwaitable_New(
|
||||
awaitable, default_value);
|
||||
Py_DECREF(awaitable);
|
||||
return new_awaitable;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue