changeset: 104699:bd141ec2973a parent: 104697:17334c1d9245 parent: 104698:b471447352ac user: INADA Naoki date: Tue Oct 25 19:11:40 2016 +0900 files: Misc/NEWS description: Issue #28430: Fix iterator of C implemented asyncio.Future doesn't accept non-None value is passed to it.send(val). diff -r 17334c1d9245 -r bd141ec2973a Misc/NEWS --- a/Misc/NEWS Tue Oct 25 10:38:07 2016 +0300 +++ b/Misc/NEWS Tue Oct 25 19:11:40 2016 +0900 @@ -97,6 +97,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 17334c1d9245 -r bd141ec2973a Modules/_asynciomodule.c --- a/Modules/_asynciomodule.c Tue Oct 25 10:38:07 2016 +0300 +++ b/Modules/_asynciomodule.c Tue Oct 25 19:11:40 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); }