atexit, sys.exit, sys.exitfunc, reaching end of source code

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Jul 12 20:15:58 EDT 2007


En Thu, 12 Jul 2007 06:30:45 -0300, carl.dhalluin at gmail.com  
<carl.dhalluin at gmail.com> escribió:

> I am getting quite confused with this SystemExit.
> If I register a custom sys.excepthook then it is never invoked
> when I do sys.exit(.)

No, sys.excepthook won't be called for SystemExit:

py> help(sys)
Help on built-in module sys:
[...]
     excepthook -- called to handle any uncaught exception other than  
SystemExit

Unfortunately help(sys.excepthook) does not provide the same information,  
neither the docs for the sys module. (Should be corrected...)

-- 
Gabriel Genellina




More information about the Python-list mailing list