diff options
Diffstat (limited to 'Doc/tutorial/errors.rst')
-rw-r--r-- | Doc/tutorial/errors.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst index 6f77def..f93a544 100644 --- a/Doc/tutorial/errors.rst +++ b/Doc/tutorial/errors.rst @@ -180,14 +180,14 @@ One may also instantiate an exception first before raising it and add any attributes to it as desired. :: >>> try: - ... raise Exception('spam', 'eggs') + ... raise Exception('spam', 'eggs') ... except Exception as inst: - ... print type(inst) # the exception instance - ... print inst.args # arguments stored in .args - ... print inst # __str__ allows args to be printed directly - ... x, y = inst.args - ... print 'x =', x - ... print 'y =', y + ... print type(inst) # the exception instance + ... print inst.args # arguments stored in .args + ... print inst # __str__ allows args to be printed directly + ... x, y = inst.args + ... print 'x =', x + ... print 'y =', y ... <type 'exceptions.Exception'> ('spam', 'eggs') |