summaryrefslogtreecommitdiff
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-11-13 17:30:03 -0800
committerGitHub <noreply@github.com>2021-11-13 17:30:03 -0800
commitbf26a6da7aaedb526c9eb1cb56b0e46d1c10384c (patch)
treeee5f31f18e34e46325e63d5e6ba4f501aeb3a11d /Lib/test/test_syntax.py
parent28326ac5f87ede140268376f0c87c3b2aba62906 (diff)
downloadcpython-git-bf26a6da7aaedb526c9eb1cb56b0e46d1c10384c.tar.gz
bpo-45738: Fix computation of error location for invalid continuation (GH-29550)
characters in the parser (cherry picked from commit 25835c518aa7446f3680b62c1fb43827e0f190d9) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
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 45b2785f34..3b79b7a0b6 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -1487,7 +1487,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