bpo-43555: Report the column offset for invalid line continuation character (GH-24939) (#24975)

(cherry picked from commit 96eeff5162)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-03-22 12:07:05 -07:00 committed by GitHub
parent c145c03281
commit 994a519915
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 6 deletions

View file

@ -973,6 +973,11 @@ def func2():
"""
self._check_error(code, "invalid syntax")
def test_invalid_line_continuation_error_position(self):
self._check_error(r"a = 3 \ 4",
"unexpected character after line continuation character",
lineno=1, offset=9)
def test_invalid_line_continuation_left_recursive(self):
# Check bpo-42218: SyntaxErrors following left-recursive rules
# (t_primary_raw in this case) need to be tested explicitly