This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Py_Main() does not return on sys.exit()
Type: Stage:
Components: Documentation Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: Rogi, georg.brandl
Priority: normal Keywords:

Created on 2009-02-12 13:00 by Rogi, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg81760 - (view) Author: Rogi (Rogi) Date: 2009-02-12 13:00
From teh documentation:
http://docs.python.org/c-api/veryhigh.html

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.

However, if teh user type sys.exit(whatever), Py_Main() is call exit()
instead of returning, which cause program termination before cleanup and
stuff.
msg84854 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-03-31 18:33
Documented in r70857.
History
Date User Action Args
2022-04-11 14:56:45adminsetgithub: 49477
2009-03-31 18:33:25georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg84854
2009-02-13 12:25:46Rogisetassignee: georg.brandl
components: + Documentation, - None
nosy: + georg.brandl
2009-02-12 13:00:47Rogicreate