mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +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
|
@ -1172,7 +1172,7 @@ class TestSpecifics(unittest.TestCase):
|
|||
x
|
||||
in
|
||||
y)
|
||||
genexp_lines = [0, 2, 0]
|
||||
genexp_lines = [0, 4, 2, 0, 4]
|
||||
|
||||
genexp_code = return_genexp.__code__.co_consts[1]
|
||||
code_lines = self.get_code_lines(genexp_code)
|
||||
|
@ -1627,7 +1627,7 @@ class TestSourcePositions(unittest.TestCase):
|
|||
self.assertOpcodeSourcePositionIs(compiled_code, 'JUMP_BACKWARD',
|
||||
line=1, end_line=2, column=1, end_column=8, occurrence=1)
|
||||
self.assertOpcodeSourcePositionIs(compiled_code, 'RETURN_CONST',
|
||||
line=1, end_line=6, column=0, end_column=32, occurrence=1)
|
||||
line=4, end_line=4, column=7, end_column=14, occurrence=1)
|
||||
|
||||
def test_multiline_async_generator_expression(self):
|
||||
snippet = textwrap.dedent("""\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue