summaryrefslogtreecommitdiff
path: root/Modules/_asynciomodule.c
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2020-10-19 15:50:36 +0100
committerGitHub <noreply@github.com>2020-10-19 15:50:36 +0100
commitc82f10450c547eb94a04ee17b7c816ff31948297 (patch)
treead305c05c5745e1a5e7c136545bec7eefa741e32 /Modules/_asynciomodule.c
parenteee6bb50c69d94280f43b47390ea9d1b5f42930c (diff)
parentb580ed1d9d55461d8dde027411b90be26cae131e (diff)
downloadcpython-git-bpo-39107.tar.gz
Merge branch 'master' into bpo-39107bpo-39107
Diffstat (limited to 'Modules/_asynciomodule.c')
-rw-r--r--Modules/_asynciomodule.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index 2151f20281..f01e5884c6 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);