diff options
| author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-03-21 10:49:12 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-21 10:49:12 -0600 |
| commit | 3bb475662ba998e1b2d26fa370794d0804e33927 (patch) | |
| tree | 47cc612ffac4eb4dda24b4eb51c6796142695ce6 /Include/cpython | |
| parent | 910a64e3013bce821bfac75377cbe88bedf265de (diff) | |
| download | cpython-git-3bb475662ba998e1b2d26fa370794d0804e33927.tar.gz | |
gh-98608: Stop Treating All Errors from _Py_NewInterpreterFromConfig() as Fatal (gh-102657)
Prior to this change, errors in _Py_NewInterpreterFromConfig() were always fatal. Instead, callers should be able to handle such errors and keep going. That's what this change supports. (This was an oversight in the original implementation of _Py_NewInterpreterFromConfig().) Note that the existing [fatal] behavior of the public Py_NewInterpreter() is preserved.
https://github.com/python/cpython/issues/98608
Diffstat (limited to 'Include/cpython')
| -rw-r--r-- | Include/cpython/initconfig.h | 1 | ||||
| -rw-r--r-- | Include/cpython/pylifecycle.h | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Include/cpython/initconfig.h b/Include/cpython/initconfig.h index a070fa9ff3..8bc681b1a9 100644 --- a/Include/cpython/initconfig.h +++ b/Include/cpython/initconfig.h @@ -25,6 +25,7 @@ PyAPI_FUNC(PyStatus) PyStatus_Exit(int exitcode); PyAPI_FUNC(int) PyStatus_IsError(PyStatus err); PyAPI_FUNC(int) PyStatus_IsExit(PyStatus err); PyAPI_FUNC(int) PyStatus_Exception(PyStatus err); +PyAPI_FUNC(PyObject *) _PyErr_SetFromPyStatus(PyStatus status); /* --- PyWideStringList ------------------------------------------------ */ diff --git a/Include/cpython/pylifecycle.h b/Include/cpython/pylifecycle.h index e1f83acbff..821b169d7a 100644 --- a/Include/cpython/pylifecycle.h +++ b/Include/cpython/pylifecycle.h @@ -62,5 +62,6 @@ PyAPI_FUNC(int) _Py_CoerceLegacyLocale(int warn); PyAPI_FUNC(int) _Py_LegacyLocaleDetected(int warn); PyAPI_FUNC(char *) _Py_SetLocaleFromEnv(int category); -PyAPI_FUNC(PyThreadState *) _Py_NewInterpreterFromConfig( - const _PyInterpreterConfig *); +PyAPI_FUNC(PyStatus) _Py_NewInterpreterFromConfig( + PyThreadState **tstate_p, + const _PyInterpreterConfig *config); |
