diff options
author | Vladimir Matveev <vladima@fb.com> | 2020-10-10 00:15:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-10 00:15:15 (GMT) |
commit | 037245c5ac46c3436f617a1f5d965929754be239 (patch) | |
tree | ce2a797b165e846d59e53ba5d530413cb573a8aa /Modules/_asynciomodule.c | |
parent | 9975cc5008c795e069ce11e2dbed2110cc12e74e (diff) | |
download | cpython-037245c5ac46c3436f617a1f5d965929754be239.zip cpython-037245c5ac46c3436f617a1f5d965929754be239.tar.gz cpython-037245c5ac46c3436f617a1f5d965929754be239.tar.bz2 |
bpo-41756: Add PyIter_Send function (#22443)
Diffstat (limited to 'Modules/_asynciomodule.c')
-rw-r--r-- | Modules/_asynciomodule.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 2151f20..f01e588 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -16,7 +16,6 @@ _Py_IDENTIFIER(add_done_callback); _Py_IDENTIFIER(call_soon); _Py_IDENTIFIER(cancel); _Py_IDENTIFIER(get_event_loop); -_Py_IDENTIFIER(send); _Py_IDENTIFIER(throw); @@ -2695,13 +2694,7 @@ task_step_impl(TaskObj *task, PyObject *exc) int gen_status = PYGEN_ERROR; if (exc == NULL) { - if (PyGen_CheckExact(coro) || PyCoro_CheckExact(coro)) { - gen_status = PyGen_Send((PyGenObject*)coro, Py_None, &result); - } - else { - result = _PyObject_CallMethodIdOneArg(coro, &PyId_send, Py_None); - gen_status = gen_status_from_result(&result); - } + gen_status = PyIter_Send(coro, Py_None, &result); } else { result = _PyObject_CallMethodIdOneArg(coro, &PyId_throw, exc); |