I consider this a code bug, not a documentation issue
as the documentation is the behavior we want.
From
http://www.python.org/doc/current/api/veryhigh.html#l2h-
47 :
int Py_Main(int argc, char **argv)
The main program for the standard interpreter. This is
made available for programs which embed Python. The
argc and argv parameters should be prepared exactly as
those which are passed to a C program's main()
function. It is important to note that the argument list
may be modified (but the contents of the strings pointed
to by the argument list are not). 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.
I have checked the code for 2.2, 2.2.1, 2.2.2, and r2.3al
In all cases the code will call exit(2) in C when an
improper commandline is given instead of returning 2.
ALL exit() calls should be removed from this module.
The return value should be passed to exit or returned
from main() by the caller of Py_Main() and NOT from
within this call.
python.c's main() would not need to be changed as it
already does this.
|