mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
bpo-46008: Return void from _PyEval_InitState(). (gh-29970)
This falls into the category of keep-allocation-and-initialization separate. It also allows us to use _PyEval_InitState() safely in functions that return void. https://bugs.python.org/issue46008
This commit is contained in:
parent
91b59a3fcd
commit
8262c96bcc
3 changed files with 7 additions and 10 deletions
|
@ -225,10 +225,12 @@ PyInterpreterState_New(void)
|
|||
_PyRuntimeState *runtime = &_PyRuntime;
|
||||
interp->runtime = runtime;
|
||||
|
||||
if (_PyEval_InitState(&interp->ceval) < 0) {
|
||||
PyThread_type_lock pending_lock = PyThread_allocate_lock();
|
||||
if (pending_lock == NULL) {
|
||||
goto out_of_memory;
|
||||
}
|
||||
|
||||
_PyEval_InitState(&interp->ceval, pending_lock);
|
||||
_PyGC_InitState(&interp->gc);
|
||||
PyConfig_InitPythonConfig(&interp->config);
|
||||
_PyType_InitCache(interp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue