mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
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.
This commit is contained in:
parent
844f4c2e12
commit
b936cf4fe0
7 changed files with 101 additions and 53 deletions
|
|
@ -311,6 +311,10 @@ might not be allowed in the current interpreter (i.e. os.fork() would fail).
|
|||
extern int _PyInterpreterState_HasFeature(PyInterpreterState *interp,
|
||||
unsigned long feature);
|
||||
|
||||
PyAPI_FUNC(PyStatus) _PyInterpreterState_New(
|
||||
PyThreadState *tstate,
|
||||
PyInterpreterState **pinterp);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue