summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index ba14c9d..a0bd050 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -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);