gh-88760: fix (Async)ExitStack handling of __context__ by belm0 · Pull Request #27089 · python/cpython
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
belm0
marked this pull request as draft
belm0
mentioned this pull request
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. TODO: unit tests
belm0
marked this pull request as ready for review
belm0 added a commit to belm0/cpython that referenced this pull request
Oct 5, 2021…ngh-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>
belm0 added a commit to belm0/cpython that referenced this pull request
Oct 5, 2021…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>
belm0
deleted the
exit_stack_context
branch
miss-islington pushed a commit that referenced this pull request
Oct 5, 2021) (GH-28730) 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> Automerge-Triggered-By: GH:njsmith
miss-islington pushed a commit that referenced this pull request
Oct 5, 2021…) (GH-28731) 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> Automerge-Triggered-By: GH:njsmith
terryjreedy
changed the title
bpo-44594: fix (Async)ExitStack handling of __context__
gh-88760: fix (Async)ExitStack handling of __context__