From: pengyu lee Date: Mon, 25 May 2026 09:09:38 +0000 (+0800) Subject: gh-150374: Fix double release of import lock in lazy import reification (#150376) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=5498eba545e950c7550c924f2e458c740a689c69;p=thirdparty%2FPython%2Fcpython.git gh-150374: Fix double release of import lock in lazy import reification (#150376) --- diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-05-25-16-00-22.gh-issue-150374.Emu6d8.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-05-25-16-00-22.gh-issue-150374.Emu6d8.rst new file mode 100644 index 000000000000..7189ca186d2b --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-05-25-16-00-22.gh-issue-150374.Emu6d8.rst @@ -0,0 +1 @@ +Fix double release of the import lock on lazy import reification errors. diff --git a/Python/import.c b/Python/import.c index 91164bc8043b..3e470d2c22cf 100644 --- a/Python/import.c +++ b/Python/import.c @@ -3928,7 +3928,6 @@ _PyImport_LoadLazyImportTstate(PyThreadState *tstate, PyObject *lazy_import) return NULL; } else if (PySet_Add(importing, lazy_import) < 0) { - _PyImport_ReleaseLock(interp); goto error; }