mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[doc] Fix error in tutorial example: type(exc) is the type rather than the instance (#102751)
This commit is contained in:
parent
9b19d3936d
commit
8709697292
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue