summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 50ff9b0..e21c7a5 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3002,7 +3002,9 @@ compiler_async_for(struct compiler *c, stmt_ty s)
/* Except block for __anext__ */
compiler_use_next_block(c, except);
- UNSET_LOC(c);
+ /* Use same line number as the iterator,
+ * as the END_ASYNC_FOR succeeds the `for`, not the body. */
+ SET_LOC(c, s->v.AsyncFor.iter);
ADDOP(c, END_ASYNC_FOR);
/* `else` block */