Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
yeah well okay, let's point at a crazy location
  • Loading branch information
ambv committed Oct 19, 2021
commit aa41b1bb76546d5d62a21859cb369511d6141c86
4 changes: 2 additions & 2 deletions Lib/test/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ def check(self, src, lineno, offset, encoding='utf-8'):
src = src.decode(encoding, 'replace')
line = src.split('\n')[lineno-1]
self.assertIn(line, cm.exception.text)

def test_error_offset_continuation_characters(self):
check = self.check
check('"\\\n"(1 for c in I,\\\n\\', 2, 2)
check('"\\\n"(1 for c in I,\\\n\\', 3, 22)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunately a regression:

>>> try:
...   compile('"\\\n"(1 for c in I,\\\n\\', "", "exec")
... except SyntaxError as e:
...   f = e
...
>>> f.lineno
2
>>> f.offset
3


def testSyntaxErrorOffset(self):
check = self.check
Expand Down