diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 5726a559cfcb73..2149d8928d596d 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1575,19 +1575,19 @@ new_interpreter(PyThreadState **tstate_p, int isolated_subinterpreter) } interp->config._isolated_interpreter = isolated_subinterpreter; - status = pycore_interp_init(tstate); + status = init_interp_create_gil(tstate); if (_PyStatus_EXCEPTION(status)) { goto error; } - status = init_interp_main(tstate); + status = pycore_interp_init(tstate); if (_PyStatus_EXCEPTION(status)) { goto error; } - status = init_interp_create_gil(tstate); + status = init_interp_main(tstate); if (_PyStatus_EXCEPTION(status)) { - return status; + goto error; } *tstate_p = tstate;