gh-116042: Fix location for SyntaxErrors of invalid escapes in the tokenizer (#116049)

This commit is contained in:
Pablo Galindo Salgado 2025-02-13 01:07:37 +00:00 committed by GitHub
parent 49b11033bd
commit 56eda25633
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 80 additions and 17 deletions

View file

@ -660,7 +660,7 @@ class CmdLineTest(unittest.TestCase):
self.assertEqual(
stderr.splitlines()[-3:],
[ b' foo = """\\q"""',
b' ^^^^^^^^',
b' ^^',
b'SyntaxError: "\\q" is an invalid escape sequence. '
b'Did you mean "\\\\q"? A raw string is also an option.'
],