https://github.com/python/cpython/commit/604ab79330bea893127518f06a10419fcb515b83
commit: 604ab79330bea893127518f06a10419fcb515b83
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: iritkatriel <[email protected]>
date: 2026-08-28T14:42:53Z
summary:

[3.14] gh-156466: fix cleanup on error in codegen_function_annotations 
(GH-156502) (#156509)

gh-156466: fix cleanup on error in codegen_function_annotations (GH-156502)
(cherry picked from commit 0e2976849375fa455934246f78386740074d83b5)

Co-authored-by: Irit Katriel <[email protected]>

files:
M Python/codegen.c

diff --git a/Python/codegen.c b/Python/codegen.c
index d13f8419a61bcd..0587a81491353c 100644
--- a/Python/codegen.c
+++ b/Python/codegen.c
@@ -1138,7 +1138,7 @@ codegen_function_annotations(compiler *c, location loc,
         RETURN_IF_ERROR_IN_SCOPE(
             c, codegen_annotations_in_scope(c, loc, args, returns, 
&annotations_len)
         );
-        ADDOP_I(c, loc, BUILD_MAP, annotations_len);
+        ADDOP_I_IN_SCOPE(c, loc, BUILD_MAP, annotations_len);
         RETURN_IF_ERROR(codegen_leave_annotations_scope(c, loc));
         return MAKE_FUNCTION_ANNOTATE;
     }

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to