mirror of
https://github.com/python/cpython.git
synced 2026-04-14 07:41:00 +00:00
[3.14] docs: fix f-string in ExceptionGroup example (GH-146108) (GH-146126)
(cherry picked from commit 2c6afb935a)
Co-authored-by: Bartosz Grabowski <58475557+bartosz-grabowski@users.noreply.github.com>
This commit is contained in:
parent
74d104d66c
commit
abd276ab3d
1 changed files with 2 additions and 2 deletions
|
|
@ -549,9 +549,9 @@ caught like any other exception. ::
|
|||
>>> try:
|
||||
... f()
|
||||
... except Exception as e:
|
||||
... print(f'caught {type(e)}: e')
|
||||
... print(f'caught {type(e)}: {e}')
|
||||
...
|
||||
caught <class 'ExceptionGroup'>: e
|
||||
caught <class 'ExceptionGroup'>: there were problems (2 sub-exceptions)
|
||||
>>>
|
||||
|
||||
By using ``except*`` instead of ``except``, we can selectively
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue