]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-108634: PyInterpreterState_New() no longer calls Py_FatalError() (#108748)
authorVictor Stinner <vstinner@python.org>
Fri, 1 Sep 2023 10:43:30 +0000 (12:43 +0200)
committerGitHub <noreply@github.com>
Fri, 1 Sep 2023 10:43:30 +0000 (12:43 +0200)
commitb936cf4fe084474970ea43dba24386f1b08e75ce
tree1e6d94b328a13412f523d6a05c065e4526b57512
parent844f4c2e12a7c637d1de93dbbb0718be06553510
gh-108634: PyInterpreterState_New() no longer calls Py_FatalError() (#108748)

pycore_create_interpreter() now returns a status, rather than
calling Py_FatalError().

* PyInterpreterState_New() now calls Py_ExitStatusException() instead
  of calling Py_FatalError() directly.
* Replace Py_FatalError() with PyStatus in init_interpreter() and
  _PyObject_InitState().
* _PyErr_SetFromPyStatus() now raises RuntimeError, instead of
  ValueError. It can now call PyErr_NoMemory(), raise MemoryError,
  if it detects _PyStatus_NO_MEMORY() error message.
Include/internal/pycore_initconfig.h
Include/internal/pycore_interp.h
Include/internal/pycore_object.h
Objects/object.c
Python/initconfig.c
Python/pylifecycle.c
Python/pystate.c