Skip to content

Commit abd276a

Browse files
[3.14] docs: fix f-string in ExceptionGroup example (GH-146108) (GH-146126)
(cherry picked from commit 2c6afb9) Co-authored-by: Bartosz Grabowski <58475557+bartosz-grabowski@users.noreply.github.com>
1 parent 74d104d commit abd276a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/tutorial/errors.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,9 @@ caught like any other exception. ::
549549
>>> try:
550550
... f()
551551
... except Exception as e:
552-
... print(f'caught {type(e)}: e')
552+
... print(f'caught {type(e)}: {e}')
553553
...
554-
caught <class 'ExceptionGroup'>: e
554+
caught <class 'ExceptionGroup'>: there were problems (2 sub-exceptions)
555555
>>>
556556

557557
By using ``except*`` instead of ``except``, we can selectively

0 commit comments

Comments
 (0)