New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-38013: make async_generator_athrow object tolerant to throwing exceptions #16070
Conversation
…ceptions when the helper is not started yet
I don't think this is the right way, although it might be. I'll need some time to carefully review the implementation. Please don't merge this.
When you're done making the requested changes, leave the comment: And if you don't make the requested changes, you will be poked with soft cushions! |
Sure, I want to wait for your approval. An alternative PR that fixes the problem is #16061 but I prefer fixing a gen helper over adding a trampoline coroutine which is safely cancellable. |
Hmmm,
Didn't know this is true (or this has changed since 3.5). Yeah, your fix is probably correct, but I'll need to still spend some time on it just to make sure I fully understand the consequences. |
I wrote the same code as you have in the snippet to prove my idea :) |
Thanks @asvetlov for the PR |
GH-16231 is a backport of this pull request to the 3.8 branch. |
GH-16232 is a backport of this pull request to the 3.7 branch. |
…ceptions (pythonGH-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 (cherry picked from commit c275312) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
…ceptions (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 (cherry picked from commit c275312) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
…ceptions (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 (cherry picked from commit c275312) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Even when the helper is not started yet.
This behavior follows conventional generator one.
There is no reason for
async_generator_athrow
to handlegen.throw()
differently.https://bugs.python.org/issue38013
Automerge-Triggered-By: @asvetlov