gh-88535: Improve syntax error for wrongly closed strings (#26633)

This commit is contained in:
Pablo Galindo Salgado 2025-02-13 01:30:20 +00:00 committed by GitHub
parent 56eda25633
commit 6fb5138776
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 1098 additions and 930 deletions

View file

@ -2303,7 +2303,7 @@ class SyntaxErrorTests(unittest.TestCase):
)
err = run_script(source.encode('cp437'))
self.assertEqual(err[-3], ' "¢¢¢¢¢¢" + f(4, x for x in range(1))')
self.assertEqual(err[-2], ' ^^^^^^^^^^^^^^^^^^^')
self.assertEqual(err[-2], ' ^^^')
# Check backwards tokenizer errors
source = '# -*- coding: ascii -*-\n\n(\n'