summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-03-10 18:22:34 +0200
committerGitHub <noreply@github.com>2018-03-10 18:22:34 +0200
commit24d3201eb7f0b39a7eaf2a5b2a2ceca10ad1f8eb (patch)
tree873738d8e87c4929a165e5541e11b29a69dd1e99 /Python/compile.c
parent5e80a71ab67045fecec46573a1892e240b569ace (diff)
downloadcpython-git-24d3201eb7f0b39a7eaf2a5b2a2ceca10ad1f8eb.tar.gz
bpo-33041: Fixed bytecode generation for "async for" with a complex target. (#6052)
A StopAsyncIteration raised on assigning or unpacking will be now propagated instead of stopping the iteration.
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 f14647b4f6..6c9e7954d6 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2473,8 +2473,8 @@ compiler_async_for(struct compiler *c, stmt_ty s)
ADDOP(c, GET_ANEXT);
ADDOP_O(c, LOAD_CONST, Py_None, consts);
ADDOP(c, YIELD_FROM);
- VISIT(c, expr, s->v.AsyncFor.target);
ADDOP(c, POP_BLOCK); /* for SETUP_FINALLY */
+ VISIT(c, expr, s->v.AsyncFor.target);
compiler_pop_fblock(c, EXCEPT, try);
ADDOP_JREL(c, JUMP_FORWARD, after_try);
@@ -4060,8 +4060,8 @@ compiler_async_comprehension_generator(struct compiler *c,
ADDOP(c, GET_ANEXT);
ADDOP_O(c, LOAD_CONST, Py_None, consts);
ADDOP(c, YIELD_FROM);
- VISIT(c, expr, gen->target);
ADDOP(c, POP_BLOCK);
+ VISIT(c, expr, gen->target);
compiler_pop_fblock(c, EXCEPT, try);
ADDOP_JREL(c, JUMP_FORWARD, after_try);