Author ezio.melotti
Recipients cate, ezio.melotti, georg.brandl, jszakmeister
Date 2009-06-06.10:13:24
SpamBayes Score 0.000284742
Marked as misclassified No
Message-id <1244283206.41.0.586583693106.issue6220@psf.upfronthosting.co.za>
In-reply-to
Content
That "typo" is intentional, it's also written in the comment:
try:
    foo = opne("file") # misspelled "open"
except:
    sys.exit("could not open file!")

This example shows how a bare except will catch the NameError caused by
'opne' and return the wrong error message, whereas "except IOError" will
only catch IOErrors and show the NameError.
History
Date User Action Args
2009-06-06 10:13:26ezio.melottisetrecipients: + ezio.melotti, georg.brandl, jszakmeister, cate
2009-06-06 10:13:26ezio.melottisetmessageid: <1244283206.41.0.586583693106.issue6220@psf.upfronthosting.co.za>
2009-06-06 10:13:25ezio.melottilinkissue6220 messages
2009-06-06 10:13:24ezio.melotticreate