os._exit vs. sys.exit

Andrew Dalke dalke at dalkescientific.com
Fri Jul 29 08:28:26 CEST 2005

Bryan wrote:
> Why does os._exit called from a Python Timer kill the whole process while 
> sys.exit does not?  On Suse.

os._exit calls the C function _exit() which does an immediate program
termination.  See for example
and note the statement "can never return".

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

				dalke at dalkescientific.com

More information about the Python-list mailing list