mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
[3.12] gh-123142: Fix too wide source locations in tracebacks of exceptions from broken iterables in comprehensions (GH-123173). (#123210)
(cherry picked from commit ec89620e5e
)
This commit is contained in:
parent
8edfa0b0b4
commit
fbbde4dc6a
8 changed files with 122 additions and 21 deletions
|
@ -5272,14 +5272,15 @@ compiler_sync_comprehension_generator(struct compiler *c, location loc,
|
|||
}
|
||||
if (IS_LABEL(start)) {
|
||||
VISIT(c, expr, gen->iter);
|
||||
ADDOP(c, loc, GET_ITER);
|
||||
ADDOP(c, LOC(gen->iter), GET_ITER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_LABEL(start)) {
|
||||
depth++;
|
||||
USE_LABEL(c, start);
|
||||
ADDOP_JUMP(c, loc, FOR_ITER, anchor);
|
||||
ADDOP_JUMP(c, LOC(gen->iter), FOR_ITER, anchor);
|
||||
}
|
||||
VISIT(c, expr, gen->target);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue