try except question - serious foo bar question, and pulling my hair out :-)
gandalf at shopzeus.com
Tue Feb 24 08:09:44 EST 2009
> It seems impossible to me. The while loop should only exit if
> stop_requested becomes set, OR if an exception is raised. However, all
> exceptions are cought and logged. But there are no exceptions logged.
> And stop_requested is NOT SET. (see the last line in the log).
> What is happening here?
It was a bad assumption. Not all exceptions are subclasses of
"Exception". In this case, an inner call raised SystemExit(0). So be
aware. Don't think that this will catch all exceptions:
Use this instead:
e = sys.exc_value
More information about the Python-list