-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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-39048: Look up __aenter__ before __aexit__ in the async with statement #17609
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change itself looks good to me - just a request for another test case to cover the second error handling branch (if we had already had such a test, we would have picked up the refleak in the previous iteration of the code).
We'll also need a NEWS entry.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
@maggyero, please address the code review when you get a chance. Thank you! |
@maggyero, thank you. I just wanted to make sure you had seen the review. |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @ncoghlan: please review the changes made to this pull request. |
Misc/NEWS.d/next/Core and Builtins/2020-01-13-14-45-22.bpo-39048.iPsj81.rst
Outdated
Show resolved
Hide resolved
Thank you for the patch! |
Thank you for the review @ncoghlan (and @rhettinger)! |
@ncoghlan Like for PR #17608, shouldn’t we back port this PR to the 3.8 branch? |
No, this one isn't eligible for backport as it's a behavioural change, whereas the previous PR was just a docs update. |
Alright @ncoghlan! |
…H-17609) * Reorder the __aenter__ and __aexit__ checks for async with * Add assertions for async with body being skipped * Swap __aexit__ and __aenter__ loading in the documentation
This PR will introduce the following changes:
__aenter__
method before the__aexit__
method in theasync with
statement;async with
statement;https://bugs.python.org/issue39048