]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-153252: Fix error handling in `_PyCompile_CodeGen` (GH-153253) (#153282)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 7 Jul 2026 18:02:59 +0000 (20:02 +0200)
committerGitHub <noreply@github.com>
Tue, 7 Jul 2026 18:02:59 +0000 (18:02 +0000)
gh-153252: Fix error handling in `_PyCompile_CodeGen` (GH-153253)
(cherry picked from commit a74280e6696125acb7628facc577d0f975c4d69e)

Co-authored-by: sobolevn <mail@sobolevn.me>
Python/compile.c

index c210c823157dd1c8dd9164ab48eed5cf71116946..6c5ef5329ffc3aaef424f47f7f67a99eddfbede0 100644 (file)
@@ -1641,7 +1641,7 @@ _PyCompile_CodeGen(PyObject *ast, PyObject *filename, PyCompilerFlags *pflags,
 
     metadata = PyDict_New();
     if (metadata == NULL) {
-        return NULL;
+        goto finally;
     }
 
     if (compiler_codegen(c, mod) < 0) {