]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-153252: Fix error handling in `_PyCompile_CodeGen` (GH-153253) (#153283)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 7 Jul 2026 17:03:10 +0000 (19:03 +0200)
committerGitHub <noreply@github.com>
Tue, 7 Jul 2026 17:03:10 +0000 (17:03 +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 a2563a434232fcaa4c15ee780bf7ad7639ca9266..fa03bbd1afa9630db2f5e89ed07d0fc9af838156 100644 (file)
@@ -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) {