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

This commit is contained in:
Pablo Galindo 2021-03-22 17:28:11 +00:00 committed by GitHub
parent 123ff266cd
commit 96eeff5162
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 6 deletions

View file

@ -1162,6 +1162,11 @@ def func2():
"""
self._check_error(code, "expected ':'")
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