bpo-32526: Closing async generator while it is running does not raise an exception#5182
bpo-32526: Closing async generator while it is running does not raise an exception#5182achimnol wants to merge 2 commits intopython:masterfrom
Conversation
* This test case is taken from njs' code at his async_generator repo: njsmith/async_generator@339fc63
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
|
Hm.. my changes makes too many existing tests ( Async generators awaiting its inner awaitables should ALLOW I hope @1st1 and @njsmith would have some better ideas than me! |
|
I guess async generators will need both a gi_running and an ag_running, or
something like that. But yeah this code is pretty tricky, I'm not sure how
to fix it either. Probably not the easiest place for an initial
contribution :-)
…On Jan 14, 2018 10:28 AM, "Joongi Kim" ***@***.***> wrote:
Closed #5182 <#5182>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5182 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAlOaOkGFN0dKpMZdCZz2EqrUTriQ4N5ks5tKkdlgaJpZM4Rdqqp>
.
|
|
I'll take a look tomorrow. |
Here are my first draft PR to pass the
async_generatortest case provided by @njsmith.I have reset
gi_runningvalue to 1 aftergen_send_ex()and_gen_throw()calls in async generators and clear it to 0 when they close.This PR obviously requires more test cases regarding
athrow()calls, but I submit at this stage to check if my approach is correct first.https://bugs.python.org/issue32526