Skip to content

bpo-36763: _PyInitError always use int for exitcode #13360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2019
Merged

bpo-36763: _PyInitError always use int for exitcode #13360

merged 1 commit into from
May 16, 2019

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 16, 2019

We cannot use "unsigned int" for exitcode on Windows, since
Py_Main() and _Py_RunMain() always return an "int".

Changes:

  • _PyPathConfig_ComputeSysPath0() now returns -1 if an exception is
    raised.
  • pymain_run_python() no longer uses _PyInitError but display the
    exception and set exitcode to 1 in case of error.
  • Fix _Py_RunMain(): return an exitcode rather than calling
    exit() on pymain_run_python() failure.
  • _Py_ExitInitError() no longer uses ExitProcess() on Windows, use
    exit() on all platforms.
  • _Py_ExitInitError() now fails with a fatal error if 'err' is not an
    error not an exit.

https://bugs.python.org/issue36763

We cannot use "unsigned int" for exitcode on Windows, since
Py_Main() and _Py_RunMain() always return an "int".

Changes:

* _PyPathConfig_ComputeSysPath0() now returns -1 if an exception is
  raised.
* pymain_run_python() no longer uses _PyInitError but display the
  exception and set exitcode to 1 in case of error.
* Fix _Py_RunMain(): return an exitcode rather than calling
  exit() on pymain_run_python() failure.
* _Py_ExitInitError() no longer uses ExitProcess() on Windows, use
  exit() on all platforms.
* _Py_ExitInitError() now fails with a fatal error if 'err' is not an
  error not an exit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants