Exceptions

2006-02-21 Thread DavidPorterHolt
Can anyone explain why the second print statement below (copied from 'Dive Into Python') generates a syntax error? As I understand exceptions, the except block should handle the exception, and the following print statement should execute normally. >>> try: fsock = open('/nothere') except I

Re: Exceptions

2006-02-21 Thread DavidPorterHolt
Here's the same clip, but run in the command line interpreter. The error gives a little more info. >>> try: ... fsock = open('/notthere') ... except IOError: ... print 'The file does not exist, exiting gracefully' ... print 'This line will always print' File "", line 5 print 'This li

Re: Exceptions

2006-02-21 Thread DavidPorterHolt
That's good to know. Thanks. -- http://mail.python.org/mailman/listinfo/python-list