8000 bpo-40513: new_interpreter() init GIL earlier (GH-19942) · python/cpython@0dd5e7a · GitHub
[go: up one dir, main page]

Skip to content

Commit 0dd5e7a

Browse files
authored
bpo-40513: new_interpreter() init GIL earlier (GH-19942)
Fix also code to handle init_interp_main() failure.
1 parent e838a93 commit 0dd5e7a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Python/pylifecycle.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,19 +1575,19 @@ new_interpreter(PyThreadState **tstate_p, int isolated_subinterpreter)
15751575
}
15761576
interp->config._isolated_interpreter = isolated_subinterpreter;
15771577

1578-
status = pycore_interp_init(tstate);
1578+
status = init_interp_create_gil(tstate);
15791579
if (_PyStatus_EXCEPTION(status)) {
15801580
goto error;
15811581
}
15821582

1583-
status = init_interp_main(tstate);
1583+
status = pycore_interp_init(tstate);
15841584
if (_PyStatus_EXCEPTION(status)) {
15851585
goto error;
15861586
}
15871587

1588-
status = init_interp_create_gil(tstate);
1588+
status = init_interp_main(tstate);
15891589
if (_PyStatus_EXCEPTION(status)) {
1590-
return status;
1590+
goto error;
15911591
}
15921592

15931593
*tstate_p = tstate;

0 commit comments

Comments
 (0)
0