]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] docs: fix f-string in ExceptionGroup example (GH-146108) (GH-146127)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 23 Mar 2026 23:08:07 +0000 (00:08 +0100)
committerGitHub <noreply@github.com>
Mon, 23 Mar 2026 23:08:07 +0000 (00:08 +0100)
(cherry picked from commit 2c6afb935ad588f32cb969345d0345e45d3a766e)

Co-authored-by: Bartosz Grabowski <58475557+bartosz-grabowski@users.noreply.github.com>
Doc/tutorial/errors.rst

index bfb281c1b7d66a7fd81af9c3e020c23ee8f70a5e..c56aeb0398eaf92c4e9a5970a67de9633348eb67 100644 (file)
@@ -545,9 +545,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