mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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
|
@ -1065,7 +1065,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)
|
||||
|
@ -1431,7 +1431,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