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:
Victor Stinner 2019-03-01 12:14:41 +01:00 committed by GitHub
parent b9f0354efc
commit dfe884759d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 191 additions and 229 deletions

View file

@ -408,7 +408,7 @@ pathconfig_global_init(void)
error:
_PyCoreConfig_Clear(&config);
_Py_FatalInitError(err);
_Py_ExitInitError(err);
}