https://github.com/python/cpython/commit/3656c15ce88f0eeb758a136c503a1d41edc88e68
commit: 3656c15ce88f0eeb758a136c503a1d41edc88e68
branch: 3.14
author: Irit Katriel <[email protected]>
committer: iritkatriel <[email protected]>
date: 2026-08-30T14:14:31+01:00
summary:

[3.14]gh-156466: fix cleanup on error after Enter in codegen_enter_scope 
(#156467) (#156617)

gh-156466: fix cleanup on error after Enter in codegen_enter_scope (#156467)

(cherry picked from commit 41b3f0af266b408438cab36625c6ad71040d38e5)

files:
M Python/codegen.c

diff --git a/Python/codegen.c b/Python/codegen.c
index c532a859a97ec7..f90ec1756cdeab 100644
--- a/Python/codegen.c
+++ b/Python/codegen.c
@@ -659,9 +659,9 @@ codegen_enter_scope(compiler *c, identifier name, int 
scope_type,
     if (scope_type == COMPILE_SCOPE_MODULE) {
         loc.lineno = 0;
     }
-    ADDOP_I(c, loc, RESUME, RESUME_AT_FUNC_START);
+    ADDOP_I_IN_SCOPE(c, loc, RESUME, RESUME_AT_FUNC_START);
     if (scope_type == COMPILE_SCOPE_MODULE) {
-        ADDOP(c, loc, ANNOTATIONS_PLACEHOLDER);
+        ADDOP_IN_SCOPE(c, loc, ANNOTATIONS_PLACEHOLDER);
     }
     return SUCCESS;
 }

_______________________________________________
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