◐ Shell
clean mode source ↗

gh-108634: PyInterpreterState_New() no longer calls Py_FatalError() by vstinner · Pull Request #108748 · python/cpython

@vstinner

pycore_create_interpreter() now returns a status exception on error,
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() if it detects
  _PyStatus_NO_MEMORY().
* init_runtime() cannot be called with _initialized=1: add an
  assertion in the caller instead.