From fe29cf09d7c4e89f881370edc940fb4796dc1240 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Tue, 7 Jul 2026 19:41:05 +0300 Subject: [PATCH] gh-153252: Fix error handling in `_PyCompile_CodeGen` (GH-153253) (cherry picked from commit a74280e6696125acb7628facc577d0f975c4d69e) Co-authored-by: sobolevn --- Python/compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/compile.c b/Python/compile.c index a2563a434232fc..fa03bbd1afa963 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -7872,7 +7872,7 @@ _PyCompile_CodeGen(PyObject *ast, PyObject *filename, PyCompilerFlags *pflags, metadata = PyDict_New(); if (metadata == NULL) { - return NULL; + goto finally; } if (compiler_enter_anonymous_scope(c, mod) < 0) {