bpo-36763: _Py_RunMain() doesn't call Py_Exit() anymore by vstinner · Pull Request #13390 · python/cpython

@vstinner

Py_Main() and _Py_RunMain() now return the exitcode rather than
calling Py_Exit(exitcode) when calling PyErr_Print() if the current
exception type is SystemExit.

* Add _Py_HandleSystemExit()
* Add pymain_exit_err_print()
* Add pymain_exit_print()