Pablo Galindo Salgado <pablog...@gmail.com> added the comment:

You can always set the exit code calling sys.exit from outside the atexit 
handlers. I concur with R. David Murray in that calling sys.exit and expect 
anything sounds like a bad idea and an abuse if the atexit system.

A normal application would call sys.exit, some cleanup code will be called in 
the atexit handlers and finally the program will exit with the code originally 
set in the first call.

How and when your application will be calling sys.exit is an application 
architecture problem, and IMHO it should not be a CPython provided 
functionality to guarantee that you can do this in the atexit handlers.

It also violates the contract that right now is in the documentation: 
SystemExit exceptions are not printed or reraiaed in atexit handlers. Changing 
this (specially the second part) will be backwards incompatible, although that 
is a second order argument.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue27035>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to