8000 [3.11] gh-103590: do not wrap a single exception raised from a try-except* by iritkatriel · Pull Request #104094 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.11] gh-103590: do not wrap a single exception raised from a try-except* #104094

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

Merged
merged 2 commits into from
May 2, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add mention in doc
  • Loading branch information
iritkatriel committed May 2, 2023
commit 7dbeb41dd4d9c21d955dad230a06e71b86fce45e
4 changes: 4 additions & 0 deletions Doc/reference/compound_stmts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ Any remaining exceptions that were not handled by any :keyword:`!except*`
clause are re-raised at the end, combined into an exception group along with
all exceptions that were raised from within :keyword:`!except*` clauses.

From version 3.11.4, when the entire :exc:`ExceptionGroup` is handled and
only one exception is raised from an :keyword:`!except*` clause, this
exception is no longer wrapped to form a new :exc:`ExceptionGroup`.

If the raised exception is not an exception group and its type matches
one of the :keyword:`!except*` clauses, it is caught and wrapped by an
exception group with an empty message string. ::
Expand Down
0