changeset: 104698:b471447352ac branch: 3.6 parent: 104696:c14a2d2a3b19 user: INADA Naoki date: Tue Oct 25 19:00:45 2016 +0900 files: Misc/NEWS Modules/_asynciomodule.c description: Issue #28430: Fix iterator of C implemented asyncio.Future doesn't accept non-None value is passed to it.send(val). diff -r c14a2d2a3b19 -r b471447352ac Misc/NEWS --- a/Misc/NEWS Tue Oct 25 10:37:55 2016 +0300 +++ b/Misc/NEWS Tue Oct 25 19:00:45 2016 +0900 @@ -29,6 +29,9 @@ 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 -r c14a2d2a3b19 -r b471447352ac Modules/_asynciomodule.c --- a/Modules/_asynciomodule.c Tue Oct 25 10:37:55 2016 +0300 +++ b/Modules/_asynciomodule.c Tue Oct 25 19:00:45 2016 +0900 @@ -815,13 +815,11 @@ } 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); }