summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/pylifecycle.c8
-rw-r--r--Python/pystate.c4
2 files changed, 11 insertions, 1 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 6d580c6..e9c1a0d 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -650,6 +650,10 @@ pycore_create_interpreter(_PyRuntimeState *runtime,
return status;
}
+ // This could be done in init_interpreter() (in pystate.c) if it
+ // didn't depend on interp->feature_flags being set already.
+ _PyObject_InitState(interp);
+
PyThreadState *tstate = _PyThreadState_New(interp);
if (tstate == NULL) {
return _PyStatus_ERR("can't make first thread");
@@ -2103,6 +2107,10 @@ new_interpreter(PyThreadState **tstate_p, const PyInterpreterConfig *config)
goto error;
}
+ // This could be done in init_interpreter() (in pystate.c) if it
+ // didn't depend on interp->feature_flags being set already.
+ _PyObject_InitState(interp);
+
status = init_interp_create_gil(tstate, config->gil);
if (_PyStatus_EXCEPTION(status)) {
goto error;
diff --git a/Python/pystate.c b/Python/pystate.c
index f0e0d41..6aed9ac 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -686,7 +686,9 @@ init_interpreter(PyInterpreterState *interp,
_obmalloc_pools_INIT(interp->obmalloc.pools);
memcpy(&interp->obmalloc.pools.used, temp, sizeof(temp));
}
- _PyObject_InitState(interp);
+
+ // We would call _PyObject_InitState() at this point
+ // if interp->feature_flags were alredy set.
_PyEval_InitState(interp, pending_lock);
_PyGC_InitState(&interp->gc);