Browse Source

Issue #28430: Fix iterator of C implemented asyncio.Future doesn't

accept non-None value is passed to it.send(val).
pull/9921/head
INADA Naoki 10 years ago
parent
commit
74c17539f2
  1. 3
      Misc/NEWS
  2. 10
      Modules/_asynciomodule.c

3
Misc/NEWS

@ -29,6 +29,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 "`").

10
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);
}

Loading…
Cancel
Save