mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
bpo-36142: Rework error reporting in pymain_main() (GH-12113)
Add a new _Py_INIT_EXIT() macro to be able to exit Python with an exitcode using _PyInitError API. Rewrite function calls by pymain_main() to use _PyInitError. Changes: * Remove _PyMain.err and _PyMain.status field * Add _Py_INIT_EXIT() macro and _PyInitError.exitcode field. * Rename _Py_FatalInitError() to _Py_ExitInitError().
This commit is contained in:
parent
b9f0354efc
commit
dfe884759d
8 changed files with 191 additions and 229 deletions
|
@ -86,7 +86,7 @@ Py_FrozenMain(int argc, char **argv)
|
|||
/* No need to call _PyCoreConfig_Clear() since we didn't allocate any
|
||||
memory: program_name is a constant string. */
|
||||
if (_Py_INIT_FAILED(err)) {
|
||||
_Py_FatalInitError(err);
|
||||
_Py_ExitInitError(err);
|
||||
}
|
||||
|
||||
#ifdef MS_WINDOWS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue