diff options
Diffstat (limited to 'Objects/genobject.c')
| -rw-r--r-- | Objects/genobject.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c index 09efbab..1393f42 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -231,7 +231,8 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc, int closing) if (PyAsyncGen_CheckExact(gen)) { PyErr_SetNone(PyExc_StopAsyncIteration); } - else { + else if (arg) { + /* Set exception if not called by gen_iternext() */ PyErr_SetNone(PyExc_StopIteration); } } |
