summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2021-11-14 01:06:41 (GMT)
committerGitHub <noreply@github.com>2021-11-14 01:06:41 (GMT)
commit25835c518aa7446f3680b62c1fb43827e0f190d9 (patch)
tree42aaedbf01d1b90eeb5987c7920d52db9bed2235 /Lib/test/test_syntax.py
parentf8da00ef04fdadf7cd9821e8ec4b317ecf3ed663 (diff)
downloadcpython-25835c518aa7446f3680b62c1fb43827e0f190d9.zip
cpython-25835c518aa7446f3680b62c1fb43827e0f190d9.tar.gz
cpython-25835c518aa7446f3680b62c1fb43827e0f190d9.tar.bz2
bpo-45738: Fix computation of error location for invalid continuation (GH-29550)
characters in the parser
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 65d18e4..f41df8c 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -1505,7 +1505,13 @@ def func2():
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)
+ lineno=1, offset=8)
+ self._check_error('1,\\#\n2',
+ "unexpected character after line continuation character",
+ lineno=1, offset=4)
+ self._check_error('\nfgdfgf\n1,\\#\n2\n',
+ "unexpected character after line continuation character",
+ lineno=3, offset=4)
def test_invalid_line_continuation_left_recursive(self):
# Check bpo-42218: SyntaxErrors following left-recursive rules