mirror of
https://github.com/python/cpython.git
synced 2025-10-03 05:35:59 +00:00
gh-98172: Fix formatting in except*
docs (GH-98173)
(cherry picked from commit 5ecf961640
)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
7b1be2ac81
commit
e0260d03f7
1 changed files with 9 additions and 9 deletions
|
@ -340,17 +340,17 @@ one except* clause, the first that matches it. ::
|
||||||
+-+---------------- 1 ----------------
|
+-+---------------- 1 ----------------
|
||||||
| ValueError: 1
|
| ValueError: 1
|
||||||
+------------------------------------
|
+------------------------------------
|
||||||
>>>
|
|
||||||
|
|
||||||
Any remaining exceptions that were not handled by any except* clause
|
Any remaining exceptions that were not handled by any :keyword:`!except*`
|
||||||
are re-raised at the end, combined into an exception group along with
|
clause are re-raised at the end, combined into an exception group along with
|
||||||
all exceptions that were raised from within except* clauses.
|
all exceptions that were raised from within :keyword:`!except*` clauses.
|
||||||
|
|
||||||
An except* clause must have a matching type, and this type cannot be a
|
An :keyword:`!except*` clause must have a matching type,
|
||||||
subclass of :exc:`BaseExceptionGroup`. It is not possible to mix except
|
and this type cannot be a subclass of :exc:`BaseExceptionGroup`.
|
||||||
and except* in the same :keyword:`try`. :keyword:`break`,
|
It is not possible to mix :keyword:`except` and :keyword:`!except*`
|
||||||
:keyword:`continue` and :keyword:`return` cannot appear in an except*
|
in the same :keyword:`try`.
|
||||||
clause.
|
:keyword:`break`, :keyword:`continue` and :keyword:`return`
|
||||||
|
cannot appear in an :keyword:`!except*` clause.
|
||||||
|
|
||||||
|
|
||||||
.. index::
|
.. index::
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue