Skip to content
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

Don't stop the loop in run_until_complete() on SystemExit and KeyboardInterrupt exceptions #337

Merged
merged 3 commits into from Feb 8, 2021

Conversation

Jackenmen
Copy link
Contributor

Fixes #336

@1st1
Copy link
Member

1st1 commented May 13, 2020

Can you add a unittest?

@Jackenmen
Copy link
Contributor Author

@1st1 I added the unit test based on CPython's equivalent and rebased the PR's branch on top of master.
Let me know if there's anything else you would want me to do.

@fantix fantix added this to Quick Fix in Fantix's Sorting Board Jan 20, 2021
@Jackenmen
Copy link
Contributor Author

Jackenmen commented Feb 1, 2021

I've rebased this on top of master since it looks like there's a new required check (although now I see it doesn't seem to work?) + it's been moved to the project board it seems. I'm still available to do any additional changes if needed so just let me know if needed.

I'm also mentioning this since I'm hoping this could get included in the next release, whenever it's ready of course :)

@fantix
Copy link
Member

fantix commented Feb 7, 2021

Thanks for the PR! The thing is the test is NOT failing without the fix, I'm looking into it now.

UPDATE: Looks like this cpython test was added before _StopError was removed. Because current asyncio will complete running the whole _ready queue before actually stopping the loop, the func() is always called. So we should fix the test both here and in asyncio.

@fantix fantix merged commit 8c471f8 into MagicStack:master Feb 8, 2021
@fantix fantix removed this from Quick Fix in Fantix's Sorting Board Feb 9, 2021
This was referenced Feb 10, 2021
@Jackenmen Jackenmen deleted the patch-1 branch February 11, 2021 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

loop.run_until_complete raises RuntimeError after catching SystemExit
3 participants