[3.15] gh-150374: Fix double release of import lock in lazy import reification (GH-150376) (#150378)

gh-150374: Fix double release of import lock in lazy import reification (GH-150376)
(cherry picked from commit 5498eba545)

Co-authored-by: pengyu lee <lipengyu@kylinos.cn>
This commit is contained in:
Miss Islington (bot) 2026-05-25 11:36:22 +02:00 committed by GitHub
parent 03244b9f04
commit acd402ecdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 1 deletions

View file

@ -0,0 +1 @@
Fix double release of the import lock on lazy import reification errors.

View file

@ -3934,7 +3934,6 @@ _PyImport_LoadLazyImportTstate(PyThreadState *tstate, PyObject *lazy_import)
return NULL;
}
else if (PySet_Add(importing, lazy_import) < 0) {
_PyImport_ReleaseLock(interp);
goto error;
}