Skip to content

Commit

Permalink
[doc] Fix error in tutorial example: type(exc) is the type rather tha…
Browse files Browse the repository at this point in the history
…n the instance (python#102751)
  • Loading branch information
jenshb authored Mar 22, 2023
1 parent 9b19d39 commit 8709697
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Doc/tutorial/errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8709697

Please sign in to comment.