mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-45408: Don't override previous tokenizer errors in the second parser pass (GH-28812)
This commit is contained in:
parent
6811fdaec8
commit
0219017df7
4 changed files with 15 additions and 2 deletions
|
@ -1075,6 +1075,14 @@ Module(
|
|||
with self.assertRaisesRegex(ValueError, msg):
|
||||
ast.literal_eval(node)
|
||||
|
||||
def test_literal_eval_syntax_errors(self):
|
||||
msg = "unexpected character after line continuation character"
|
||||
with self.assertRaisesRegex(SyntaxError, msg):
|
||||
ast.literal_eval(r'''
|
||||
\
|
||||
(\
|
||||
\ ''')
|
||||
|
||||
def test_bad_integer(self):
|
||||
# issue13436: Bad error message with invalid numeric values
|
||||
body = [ast.ImportFrom(module='time',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue