https://github.com/python/cpython/commit/55f75ea9143ed150bc6885204844ac91a10eb86c
commit: 55f75ea9143ed150bc6885204844ac91a10eb86c
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-10-10T13:31:16+03:00
summary:

[3.15] gh-156466: fix cleanup on error in codegen_function_annotations 
(GH-156502) (GH-156508)

(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 dbe889c5441182..1325a59710ed00 100644
--- a/Python/codegen.c
+++ b/Python/codegen.c
@@ -1178,7 +1178,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