mirror of
https://github.com/python/cpython.git
synced 2025-07-16 15:55:18 +00:00
gh-123142: Fix too wide source locations in tracebacks of exceptions from broken iterables in comprehensions (#123173)
This commit is contained in:
parent
a4fd7aa4a6
commit
ec89620e5e
8 changed files with 122 additions and 22 deletions
|
@ -5183,14 +5183,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