mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-44622: Set line number of END_ASYNC_FOR to match that of iterator. (GH-27160)
This commit is contained in:
parent
b83861f026
commit
f333ab0f2e
2 changed files with 14 additions and 2 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue