mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-45811: Improve error message when source code contains invisible control characters (GH-29654)
This commit is contained in:
parent
7a1d932528
commit
81f4e116ef
3 changed files with 11 additions and 0 deletions
|
@ -1566,6 +1566,9 @@ def func2():
|
|||
for paren in ")]}":
|
||||
self._check_error(paren + "1 + 2", f"unmatched '\\{paren}'")
|
||||
|
||||
def test_invisible_characters(self):
|
||||
self._check_error('print\x17("Hello")', "invalid non-printable character")
|
||||
|
||||
def test_match_call_does_not_raise_syntax_error(self):
|
||||
code = """
|
||||
def match(x):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue