diff options
author | John Belmonte <john@neggie.net> | 2021-10-04 06:49:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-04 06:49:55 (GMT) |
commit | e6d1aa1ac65b6908fdea2c70ec3aa8c4f1dffcb5 (patch) | |
tree | 317af9f26a2c7233a73b2fadccd23f91b5f254c5 /Misc/NEWS.d/next/Library/2021-07-12-10-32-48.bpo-44594.eEa5zi.rst | |
parent | a25dcaefb7c4eb0767a112cd31fe0b055f168844 (diff) | |
download | cpython-e6d1aa1ac65b6908fdea2c70ec3aa8c4f1dffcb5.zip cpython-e6d1aa1ac65b6908fdea2c70ec3aa8c4f1dffcb5.tar.gz cpython-e6d1aa1ac65b6908fdea2c70ec3aa8c4f1dffcb5.tar.bz2 |
bpo-44594: fix (Async)ExitStack handling of __context__ (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.
Diffstat (limited to 'Misc/NEWS.d/next/Library/2021-07-12-10-32-48.bpo-44594.eEa5zi.rst')
-rw-r--r-- | Misc/NEWS.d/next/Library/2021-07-12-10-32-48.bpo-44594.eEa5zi.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2021-07-12-10-32-48.bpo-44594.eEa5zi.rst b/Misc/NEWS.d/next/Library/2021-07-12-10-32-48.bpo-44594.eEa5zi.rst new file mode 100644 index 0000000..a2bfd8f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-07-12-10-32-48.bpo-44594.eEa5zi.rst @@ -0,0 +1,3 @@ +Fix an edge case of :class:`ExitStack` and :class:`AsyncExitStack` exception +chaining. They will now match ``with`` block behavior when ``__context__`` is +explicitly set to ``None`` when the exception is in flight. |