mirror of
https://github.com/python/cpython.git
synced 2025-08-25 03:04:55 +00:00
Set line number of END_ASYNC_FOR so that it doesn't show in traces. (GH-27255)
This commit is contained in:
parent
9ee12cf325
commit
7ebd7465a5
2 changed files with 50 additions and 0 deletions
|
@ -2816,6 +2816,12 @@ compiler_async_for(struct compiler *c, stmt_ty s)
|
|||
|
||||
/* Except block for __anext__ */
|
||||
compiler_use_next_block(c, except);
|
||||
|
||||
/* We don't want to trace the END_ASYNC_FOR, so make sure
|
||||
* that it has the same lineno as the following instruction. */
|
||||
if (asdl_seq_LEN(s->v.For.orelse)) {
|
||||
SET_LOC(c, (stmt_ty)asdl_seq_GET(s->v.For.orelse, 0));
|
||||
}
|
||||
ADDOP(c, END_ASYNC_FOR);
|
||||
|
||||
/* `else` block */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue