bpo-36763: Rework _PyInitError API (GH-13031)

* Remove _PyInitError.user_err field and _Py_INIT_USER_ERR() macro:
  use _Py_INIT_ERR() instead. _Py_ExitInitError() now longer calls
  abort() on error: exit with exit code 1 instead.
* Add _PyInitError._type private field.
* exitcode field type is now unsigned int on Windows.
* Rename prefix field to _func.
* Rename msg field to err_msg.
This commit is contained in:
Victor Stinner 2019-05-01 05:35:33 +02:00 committed by GitHub
parent c4e671eec2
commit db71975431
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 57 additions and 45 deletions

View file

@ -570,7 +570,7 @@ exit_sigint(void)
static void _Py_NO_RETURN
pymain_exit_error(_PyInitError err)
{
if (_Py_INIT_HAS_EXITCODE(err)) {
if (_Py_INIT_IS_EXIT(err)) {
/* If it's an error rather than a regular exit, leave Python runtime
alive: _Py_ExitInitError() uses the current exception and use
sys.stdout in this case. */