bpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509)

PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no
longer return PyStatus: they cannot fail anymore.
(cherry picked from commit 8462a4936b)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
This commit is contained in:
Miss Islington (bot) 2019-10-01 03:26:04 -07:00 committed by GitHub
parent 938c00ca9e
commit d49f096cc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 56 additions and 216 deletions

View file

@ -206,14 +206,7 @@ PyInterpreterState_New(void)
interp->id_refcount = -1;
interp->check_interval = 100;
PyStatus status = PyConfig_InitPythonConfig(&interp->config);
if (_PyStatus_EXCEPTION(status)) {
/* Don't report status to caller: PyConfig_InitPythonConfig()
can only fail with a memory allocation error. */
PyConfig_Clear(&interp->config);
PyMem_RawFree(interp);
return NULL;
}
PyConfig_InitPythonConfig(&interp->config);
interp->eval_frame = _PyEval_EvalFrameDefault;
#ifdef HAVE_DLOPEN