bpo-32030: Cleanup pymain_main() (#4935)

* Reorganize pymain_main() to make the code more flat
* Clear configurations before pymain_update_sys_path()
* Mark Py_FatalError() and _Py_FatalInitError() with _Py_NO_RETURN
* Replace _PyMain.run_code variable with a new RUN_CODE() macro
* Move _PyMain.cf into a local variable in pymain_run_python()
This commit is contained in:
Victor Stinner 2017-12-20 01:41:59 +01:00 committed by GitHub
parent c4bca95106
commit 1976086362
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 101 additions and 79 deletions

View file

@ -2003,13 +2003,13 @@ exit:
}
}
void
void _Py_NO_RETURN
Py_FatalError(const char *msg)
{
fatal_error(NULL, msg, -1);
}
void
void _Py_NO_RETURN
_Py_FatalInitError(_PyInitError err)
{
/* On "user" error: exit with status 1.