summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2021-11-14 01:47:27 (GMT)
committerGitHub <noreply@github.com>2021-11-14 01:47:27 (GMT)
commit142fcb40b6e460fa9b4a89fe9846b1ce4176354e (patch)
tree0b9561fbe6a6db3b46c99fde6a5edf5893cb1503 /Lib/test/test_syntax.py
parent3e0b830e859ca8792401bfd1402d659f56f99941 (diff)
downloadcpython-142fcb40b6e460fa9b4a89fe9846b1ce4176354e.zip
cpython-142fcb40b6e460fa9b4a89fe9846b1ce4176354e.tar.gz
cpython-142fcb40b6e460fa9b4a89fe9846b1ce4176354e.tar.bz2
bpo-45738: Fix computation of error location for invalid continuation characters in the parser (GH-29550) (GH-29552)
(cherry picked from commit 25835c518aa7446f3680b62c1fb43827e0f190d9)
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 eaa94ea..46f27d0 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -953,7 +953,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=(10 if support.use_old_parser() else 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