[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:
Miss Islington (bot) 2026-03-24 00:09:00 +01:00 committed by GitHub
parent 74d104d66c
commit abd276ab3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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