summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-11-02 10:18:43 (GMT)
committerGitHub <noreply@github.com>2023-11-02 10:18:43 (GMT)
commit52cc4af6ae9002f11605f91b672746c127494efd (patch)
tree1bb4c679b3e179fdb9ccbacff4316c98fd594e79 /Python/compile.c
parent970e719a7a829bddc647bbaa668dd8603abdddef (diff)
downloadcpython-52cc4af6ae9002f11605f91b672746c127494efd.zip
cpython-52cc4af6ae9002f11605f91b672746c127494efd.tar.gz
cpython-52cc4af6ae9002f11605f91b672746c127494efd.tar.bz2
gh-111354: simplify detection of RESUME after YIELD_VALUE at except-depth 1 (#111459)
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 30005c3..1604e14 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1549,7 +1549,7 @@ compiler_add_yield_from(struct compiler *c, location loc, int await)
// Set up a virtual try/except to handle when StopIteration is raised during
// a close or throw call. The only way YIELD_VALUE raises if they do!
ADDOP_JUMP(c, loc, SETUP_FINALLY, fail);
- ADDOP_I(c, loc, YIELD_VALUE, 0);
+ ADDOP(c, loc, YIELD_VALUE);
ADDOP(c, NO_LOCATION, POP_BLOCK);
ADDOP_I(c, loc, RESUME, await ? RESUME_AFTER_AWAIT : RESUME_AFTER_YIELD_FROM);
ADDOP_JUMP(c, loc, JUMP_NO_INTERRUPT, send);
@@ -4159,7 +4159,7 @@ addop_yield(struct compiler *c, location loc) {
if (c->u->u_ste->ste_generator && c->u->u_ste->ste_coroutine) {
ADDOP_I(c, loc, CALL_INTRINSIC_1, INTRINSIC_ASYNC_GEN_WRAP);
}
- ADDOP_I(c, loc, YIELD_VALUE, 0);
+ ADDOP(c, loc, YIELD_VALUE);
ADDOP_I(c, loc, RESUME, RESUME_AFTER_YIELD);
return SUCCESS;
}