]> granicus.if.org Git - python/commit
bpo-36763: _PyInitError always use int for exitcode (GH-13360)
authorVictor Stinner <vstinner@redhat.com>
Thu, 16 May 2019 14:39:26 +0000 (16:39 +0200)
committerGitHub <noreply@github.com>
Thu, 16 May 2019 14:39:26 +0000 (16:39 +0200)
commitdbacfc227381fbc7b3c886ea0bd7806ab3dc62c2
tree7669139306b262719531d501001f417fb113f17b
parent6e7890028213b30939327e7cf885bf097fc14472
bpo-36763: _PyInitError always use int for exitcode (GH-13360)

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.
Include/cpython/coreconfig.h
Modules/main.c
Python/pathconfig.c
Python/pylifecycle.c