os._exit vs. sys.exit

Peter Hansen peter at engcorp.com
Fri Jul 29 13:58:16 CEST 2005


Andrew Dalke wrote:
> sys.exit() is identical to "raise SystemExit()".  It raises a Python
> exception which may be caught at a higher level in the program stack.

And which *is* caught at the highest levels of threading.Thread objects 
(which Timer is based on).  Exceptions raised (and caught or not) in a 
Thread do not have any effect on the main thread, and thus don't affect 
the interpreter as a whole.

-Peter



More information about the Python-list mailing list