https://github.com/python/cpython/commit/0e2976849375fa455934246f78386740074d83b5
commit: 0e2976849375fa455934246f78386740074d83b5
branch: main
author: Irit Katriel <[email protected]>
committer: iritkatriel <[email protected]>
date: 2026-08-28T11:25:52+01:00
summary:

gh-156466: fix cleanup on error in codegen_function_annotations (#156502)

files:
M Python/codegen.c

diff --git a/Python/codegen.c b/Python/codegen.c
index df52f2c734e69a..ce577314d49fb0 100644
--- a/Python/codegen.c
+++ b/Python/codegen.c
@@ -1196,7 +1196,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