bpo-40513: new_interpreter() init GIL earlier (GH-19942)
Fix also code to handle init_interp_main() failure.
This commit is contained in:
parent
e838a9324c
commit
0dd5e7a718
|
@ -1575,6 +1575,11 @@ new_interpreter(PyThreadState **tstate_p, int isolated_subinterpreter)
|
|||
}
|
||||
interp->config._isolated_interpreter = isolated_subinterpreter;
|
||||
|
||||
status = init_interp_create_gil(tstate);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
status = pycore_interp_init(tstate);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
goto error;
|
||||
|
@ -1585,11 +1590,6 @@ new_interpreter(PyThreadState **tstate_p, int isolated_subinterpreter)
|
|||
goto error;
|
||||
}
|
||||
|
||||
status = init_interp_create_gil(tstate);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
*tstate_p = tstate;
|
||||
return _PyStatus_OK();
|
||||
|
||||
|
|
Loading…
Reference in New Issue