From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 22 Mar 2023 18:51:48 +0000 (-0700) Subject: [doc] Fix error in tutorial example: type(exc) is the type rather than the instance... X-Git-Tag: v3.11.3~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f79cfb662589a0c1a5fdb35a5ed429c07c93ebd6;p=thirdparty%2FPython%2Fcpython.git [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@users.noreply.github.com> --- 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