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

bpo-44566: resolve differences between asynccontextmanager and contextmanager #27024

Merged
merged 9 commits into from Jul 20, 2021

Conversation

@graingert
Copy link
Contributor

@graingert graingert commented Jul 4, 2021

https://bugs.python.org/issue44566

Lib/contextlib.py Outdated Show resolved Hide resolved
@graingert graingert changed the title resolve differences between asynccontextmanager and contextmanager bpo-44566 resolve differences between asynccontextmanager and contextmanager Jul 5, 2021
@graingert graingert changed the title bpo-44566 resolve differences between asynccontextmanager and contextmanager bpo-44566: resolve differences between asynccontextmanager and contextmanager Jul 5, 2021
@contextmanager
def woohoo():
yield
try:
with self.assertWarnsRegex(DeprecationWarning,
Copy link
Contributor Author

@graingert graingert Jul 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this warning is from py2?

Copy link
Contributor Author

@graingert graingert Jul 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah the exception means this warning is never checked for

@graingert graingert marked this pull request as ready for review Jul 5, 2021
@graingert graingert requested a review from 1st1 as a code owner Jul 5, 2021
@graingert
Copy link
Contributor Author

@graingert graingert commented Jul 5, 2021

Copy link
Contributor

@adamchainz adamchainz left a comment

LGTM apart from some small comments

Lib/contextlib.py Outdated Show resolved Hide resolved
Lib/contextlib.py Show resolved Hide resolved
@ambv ambv merged commit 7f1c330 into python:main Jul 20, 2021
13 checks passed
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Jul 20, 2021

@ambv: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 20, 2021

Thanks @graingert for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒🤖

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 20, 2021

Thanks @graingert for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒🤖

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Jul 20, 2021

GH-27266 is a backport of this pull request to the 3.10 branch.

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jul 20, 2021

Sorry, @graingert and @ambv, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 7f1c330da31c54e028dceaf3610877914c2a4497 3.9

miss-islington added a commit to miss-islington/cpython that referenced this issue Jul 20, 2021
…tmanager (pythonGH-27024)

(cherry picked from commit 7f1c330)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
@graingert graingert deleted the patch-8 branch Jul 20, 2021
ambv added a commit to ambv/cpython that referenced this issue Jul 20, 2021
…contextmanager (pythonGH-27024).

(cherry picked from commit 7f1c330)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Jul 20, 2021

GH-27269 is a backport of this pull request to the 3.9 branch.

ambv pushed a commit that referenced this issue Jul 20, 2021
…tmanager (GH-27024) (#27266)

(cherry picked from commit 7f1c330)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
ambv added a commit that referenced this issue Jul 20, 2021
…contextmanager (GH-27024). (#27269)

(cherry picked from commit 7f1c330)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
JuniorJPDJ added a commit to JuniorJPDJ/cpython that referenced this issue Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants