diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2019-09-17 12:59:49 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-09-17 12:59:49 (GMT) |
commit | c275312a6284bd319ea33c9abd7e15c230eca43f (patch) | |
tree | 17639459db0543af603b2bd5f1b7fcc9e02c59e7 /Objects | |
parent | 5f5f11faf9de0d8dcbe1a8a4eb35d2a4232d6eaa (diff) | |
download | cpython-c275312a6284bd319ea33c9abd7e15c230eca43f.zip cpython-c275312a6284bd319ea33c9abd7e15c230eca43f.tar.gz cpython-c275312a6284bd319ea33c9abd7e15c230eca43f.tar.bz2 |
bpo-38013: make async_generator_athrow object tolerant to throwing exceptions (GH-16070)
Even when the helper is not started yet.
This behavior follows conventional generator one.
There is no reason for `async_generator_athrow` to handle `gen.throw()` differently.
https://bugs.python.org/issue38013
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/genobject.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c index 9f490b4..82e6e55 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1884,11 +1884,6 @@ async_gen_athrow_throw(PyAsyncGenAThrow *o, PyObject *args) { PyObject *retval; - if (o->agt_state == AWAITABLE_STATE_INIT) { - PyErr_SetString(PyExc_RuntimeError, NON_INIT_CORO_MSG); - return NULL; - } - if (o->agt_state == AWAITABLE_STATE_CLOSED) { PyErr_SetNone(PyExc_StopIteration); return NULL; |