Skip to content

[3.9] bpo-44594: fix (Async)ExitStack handling of __context__ (gh-27089)#28731

Merged
miss-islington merged 1 commit into
python:3.9from
belm0:backport-e6d1aa1-3.9
Oct 5, 2021
Merged

[3.9] bpo-44594: fix (Async)ExitStack handling of __context__ (gh-27089)#28731
miss-islington merged 1 commit into
python:3.9from
belm0:backport-e6d1aa1-3.9

Conversation

@belm0
Copy link
Copy Markdown
Contributor

@belm0 belm0 commented Oct 5, 2021

Make enter_context(foo()) / enter_async_context(foo()) equivalent to
[async] with foo() regarding context when an exception is raised.

Previously exceptions would be caught and re-raised with the wrong
context when explicitly overriding context with None..
(cherry picked from commit e6d1aa1)

Co-authored-by: John Belmonte john@neggie.net

https://bugs.python.org/issue44594

Automerge-Triggered-By: GH:njsmith

…gh-27089)

* bpo-44594: fix (Async)ExitStack handling of __context__

Make enter_context(foo()) / enter_async_context(foo()) equivalent to
`[async] with foo()` regarding __context__ when an exception is raised.

Previously exceptions would be caught and re-raised with the wrong
context when explicitly overriding __context__ with None..
(cherry picked from commit e6d1aa1)

Co-authored-by: John Belmonte <john@neggie.net>
@miss-islington
Copy link
Copy Markdown
Contributor

@belm0: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 7c2a040 into python:3.9 Oct 5, 2021
@belm0 belm0 deleted the backport-e6d1aa1-3.9 branch October 5, 2021 06:38
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.

5 participants