diff options
| author | Victor Stinner <vstinner@python.org> | 2020-05-05 18:16:37 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-05 18:16:37 (GMT) |
| commit | 0dd5e7a718997da2026ed64fe054dc36cae4fee7 (patch) | |
| tree | 6c0c35cbdb268e595221a8b52cb0a757852f1384 /Python | |
| parent | e838a9324c1719bb917ca81ede8d766b5cb551f4 (diff) | |
| download | cpython-0dd5e7a718997da2026ed64fe054dc36cae4fee7.zip cpython-0dd5e7a718997da2026ed64fe054dc36cae4fee7.tar.gz cpython-0dd5e7a718997da2026ed64fe054dc36cae4fee7.tar.bz2 | |
bpo-40513: new_interpreter() init GIL earlier (GH-19942)
Fix also code to handle init_interp_main() failure.
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/pylifecycle.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 5726a55..2149d89 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; |
