[Python-checkins] cpython (merge default -> default): Merge heads

serhiy.storchaka python-checkins at python.org
Tue Oct 25 06:48:19 EDT 2016


https://hg.python.org/cpython/rev/9910ce2009bd
changeset:   104703:9910ce2009bd
parent:      104701:24c3f997bd1a
parent:      104699:bd141ec2973a
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Tue Oct 25 13:47:55 2016 +0300
summary:
  Merge heads

files:
  Misc/NEWS                |   3 +++
  Modules/_asynciomodule.c |  10 ++++------
  2 files changed, 7 insertions(+), 6 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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 --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
--- a/Modules/_asynciomodule.c
+++ b/Modules/_asynciomodule.c
@@ -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);
 }
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list