[Python-checkins] [doc] Fix error in tutorial example: type(exc) is the type rather than the instance (GH-102751)

miss-islington webhook-mailer at python.org
Wed Mar 22 14:51:56 EDT 2023


https://github.com/python/cpython/commit/f79cfb662589a0c1a5fdb35a5ed429c07c93ebd6
commit: f79cfb662589a0c1a5fdb35a5ed429c07c93ebd6
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2023-03-22T11:51:48-07:00
summary:

[doc] Fix error in tutorial example: type(exc) is the type rather than the instance (GH-102751)

(cherry picked from commit 8709697292c67254ba836d7e88d1eba08c4a351a)

Co-authored-by: Jens-Hilmar Bradt <17177271+jenshb at users.noreply.github.com>

files:
M Doc/tutorial/errors.rst

diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst
index e09c829b8e97..ca5dc3314c63 100644
--- a/Doc/tutorial/errors.rst
+++ b/Doc/tutorial/errors.rst
@@ -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



More information about the Python-checkins mailing list