diff options
author | INADA Naoki <songofacandy@gmail.com> | 2016-10-25 10:00:45 (GMT) |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2016-10-25 10:00:45 (GMT) |
commit | 74c17539f26cdefff2b92c93f4233e59106a3f3f (patch) | |
tree | 916789c84fecc44ae6d31729c3dc88c22af218b4 /Modules | |
parent | c3adf1e09b2cd981e4f3e07ef93c19c9513f4846 (diff) | |
download | cpython-74c17539f26cdefff2b92c93f4233e59106a3f3f.zip cpython-74c17539f26cdefff2b92c93f4233e59106a3f3f.tar.gz cpython-74c17539f26cdefff2b92c93f4233e59106a3f3f.tar.bz2 |
Issue #28430: Fix iterator of C implemented asyncio.Future doesn't
accept non-None value is passed to it.send(val).
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_asynciomodule.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 37298cc..a3c96c8 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -815,13 +815,11 @@ FutureIter_iternext(futureiterobject *it) } static PyObject * -FutureIter_send(futureiterobject *self, PyObject *arg) +FutureIter_send(futureiterobject *self, PyObject *unused) { - if (arg != Py_None) { - PyErr_Format(PyExc_TypeError, - "can't send non-None value to a FutureIter"); - return NULL; - } + /* Future.__iter__ doesn't care about values that are pushed to the + * generator, it just returns "self.result(). + */ return FutureIter_iternext(self); } |