mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
bpo-40176: Improve error messages for unclosed string literals (GH-19346)
Automerge-Triggered-By: GH:isidentical
This commit is contained in:
parent
c3f167d7b2
commit
a698d52c39
7 changed files with 34 additions and 32 deletions
|
@ -206,7 +206,7 @@ class ExceptionTests(unittest.TestCase):
|
|||
check(b'# -*- coding: cp1251 -*-\nPython = "\xcf\xb3\xf2\xee\xed" +',
|
||||
2, 19, encoding='cp1251')
|
||||
check(b'Python = "\xcf\xb3\xf2\xee\xed" +', 1, 18)
|
||||
check('x = "a', 1, 7)
|
||||
check('x = "a', 1, 5)
|
||||
check('lambda x: x = 2', 1, 1)
|
||||
check('f{a + b + c}', 1, 2)
|
||||
check('[file for str(file) in []\n])', 1, 11)
|
||||
|
@ -238,7 +238,7 @@ class ExceptionTests(unittest.TestCase):
|
|||
|
||||
def baz():
|
||||
'''quux'''
|
||||
""", 9, 20)
|
||||
""", 9, 24)
|
||||
check("pass\npass\npass\n(1+)\npass\npass\npass", 4, 4)
|
||||
check("(1+)", 1, 4)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue