mirror of https://github.com/python/cpython
gh-111789: Use PyDict_GetItemRef() in Modules/_asynciomodule.c (GH-112072)
This commit is contained in:
parent
6c214dea7c
commit
d4f83e1e3a
|
@ -3514,15 +3514,11 @@ _asyncio_current_task_impl(PyObject *module, PyObject *loop)
|
||||||
Py_INCREF(loop);
|
Py_INCREF(loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = PyDict_GetItemWithError(state->current_tasks, loop);
|
int rc = PyDict_GetItemRef(state->current_tasks, loop, &ret);
|
||||||
Py_DECREF(loop);
|
Py_DECREF(loop);
|
||||||
if (ret == NULL && PyErr_Occurred()) {
|
if (rc == 0) {
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
else if (ret == NULL) {
|
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
Py_INCREF(ret);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue