]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[doc] Fix error in tutorial example: type(exc) is the type rather than the instance...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 22 Mar 2023 18:51:48 +0000 (11:51 -0700)
committerGitHub <noreply@github.com>
Wed, 22 Mar 2023 18:51:48 +0000 (11:51 -0700)
(cherry picked from commit 8709697292c67254ba836d7e88d1eba08c4a351a)

Co-authored-by: Jens-Hilmar Bradt <17177271+jenshb@users.noreply.github.com>
Doc/tutorial/errors.rst

index e09c829b8e97213140014646f9ebae19ec08ccec..ca5dc3314c63b6c1499418b6f28b8f8cdd59e45f 100644 (file)
@@ -160,7 +160,7 @@ accessing ``.args``.  ::
    >>> try:
    ...     raise Exception('spam', 'eggs')
    ... except Exception as inst:
-   ...     print(type(inst))    # the exception instance
+   ...     print(type(inst))    # the exception type
    ...     print(inst.args)     # arguments stored in .args
    ...     print(inst)          # __str__ allows args to be printed directly,
    ...                          # but may be overridden in exception subclasses