[issue6498] Py_Main() does not return on SystemExit
Rogi
report at bugs.python.org
Tue Mar 29 06:15:33 CEST 2011
Rogi <rogi at linuxmail.org> added the comment:
@mhammond
You said:
"The docs are wrong regardless - I don't think anyone would
suggest the behaviour match the docs regarding SystemError -
having Py_Main return on SystemError would be backwards
incompatible."
but teh problem is:
Py_Main() calls exit() on SystemExit instead of returning.
and documentation says:
"The return value will be the integer passed to the sys.exit()
function, 1 if the interpreter exits due to an exception, or 2
if the parameter list does not represent a valid Python command
line."
which seems to be teh desired and broken behaviour.
Similar problems happen with other functions, such as
PyRun_SimpleString(), and teh solution to all those issues are related.
What teh docs says currently about SystemError calling exit() is just
_WRONG_.
Also, I am not asking for a new feature. I'm pointing that there is
something wrong, with teh docs or teh code, and that it is probably teh
code.
I hope this clarified teh situation.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6498>
_______________________________________
More information about the Python-bugs-list
mailing list