summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-10-25 10:47:55 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-10-25 10:47:55 (GMT)
commitab5a7f675db00ba64da2e59dead30a0a393c1319 (patch)
tree3ec5ac96fae13e055a78fb8235d9085522c28269
parenta4f882306394488c06f0412369d52b25e516a0c6 (diff)
parent12a98e8cbbc2a1ccdfa34beffb0369528093bd37 (diff)
downloadcpython-ab5a7f675db00ba64da2e59dead30a0a393c1319.zip
cpython-ab5a7f675db00ba64da2e59dead30a0a393c1319.tar.gz
cpython-ab5a7f675db00ba64da2e59dead30a0a393c1319.tar.bz2
Merge heads
-rw-r--r--Misc/NEWS3
-rw-r--r--Modules/_asynciomodule.c10
2 files changed, 7 insertions, 6 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 130e3e2..9ae27ac 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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);
}