exception problem

Chris Angelico rosuav at gmail.com
Mon Jun 25 11:22:08 EDT 2012


On Tue, Jun 26, 2012 at 1:14 AM, Charles Hixson
<charleshixsn at earthlink.net> wrote:
> I read that that would happen, but "  print (sys.exc_info()[:2]) " didn't
> even yield a blank line.  It must have executed, because the print statement
> on the line before it executed, and there wasn't a loop or a jump (and also
> execution continued "normally" [the code still has bugs] afterward even if
> the finally isn't included).

Unless it threw an exception, such as NameError if you haven't
imported sys. In that case, execution will continue through the
'finally' clause and then raise the exception (at least, I think
that's how it goes - raising exceptions in exception handlers is not
something I've made a study of).

ChrisA



More information about the Python-list mailing list