mirror of
https://github.com/python/cpython.git
synced 2025-10-18 04:38:07 +00:00
gh-112387: Fix error positions for decoded strings with backwards tokenize errors (#112409)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
This commit is contained in:
parent
2c8b191742
commit
45d648597b
3 changed files with 10 additions and 0 deletions
|
@ -2334,6 +2334,10 @@ func(
|
|||
"""
|
||||
self._check_error(code, "parenthesis '\\)' does not match opening parenthesis '\\['")
|
||||
|
||||
# Examples with dencodings
|
||||
s = b'# coding=latin\n(aaaaaaaaaaaaaaaaa\naaaaaaaaaaa\xb5'
|
||||
self._check_error(s, "'\(' was never closed")
|
||||
|
||||
def test_error_string_literal(self):
|
||||
|
||||
self._check_error("'blech", r"unterminated string literal \(.*\)$")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue