diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-03-10 16:22:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-10 16:22:34 (GMT) |
commit | 24d3201eb7f0b39a7eaf2a5b2a2ceca10ad1f8eb (patch) | |
tree | 873738d8e87c4929a165e5541e11b29a69dd1e99 /Python/compile.c | |
parent | 5e80a71ab67045fecec46573a1892e240b569ace (diff) | |
download | cpython-24d3201eb7f0b39a7eaf2a5b2a2ceca10ad1f8eb.zip cpython-24d3201eb7f0b39a7eaf2a5b2a2ceca10ad1f8eb.tar.gz cpython-24d3201eb7f0b39a7eaf2a5b2a2ceca10ad1f8eb.tar.bz2 |
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c index f14647b..6c9e795 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); |