diff options
author | INADA Naoki <songofacandy@gmail.com> | 2016-10-25 10:11:40 (GMT) |
---|---|---|
committer | INADA Naoki <songofacandy@gmail.com> | 2016-10-25 10:11:40 (GMT) |
commit | 12a98e8cbbc2a1ccdfa34beffb0369528093bd37 (patch) | |
tree | 4be965ac295d1030b7c7deaab726d532f5767679 | |
parent | 8416196197187c7fd59b20eed890d5235d6fa3d3 (diff) | |
parent | 74c17539f26cdefff2b92c93f4233e59106a3f3f (diff) | |
download | cpython-12a98e8cbbc2a1ccdfa34beffb0369528093bd37.zip cpython-12a98e8cbbc2a1ccdfa34beffb0369528093bd37.tar.gz cpython-12a98e8cbbc2a1ccdfa34beffb0369528093bd37.tar.bz2 |
Issue #28430: Fix iterator of C implemented asyncio.Future doesn't
accept non-None value is passed to it.send(val).
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Modules/_asynciomodule.c | 10 |
2 files changed, 7 insertions, 6 deletions
@@ -97,6 +97,9 @@ Core and Builtins Library ------- +- Issue #28430: Fix iterator of C implemented asyncio.Future doesn't accept + non-None value is passed to it.send(val). + - Issue #27025: Generated names for Tkinter widgets now start by the "!" prefix for readability (was "`"). 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); } |