mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-40267: Fix message when last input character produces a SyntaxError (GH-19521)
When there is a SyntaxError after reading the last input character from the tokenizer and if no newline follows it, the error message used to be `unexpected EOF while parsing`, which is wrong.
This commit is contained in:
parent
574547a75c
commit
9a4b38f66b
5 changed files with 13 additions and 1 deletions
|
@ -713,7 +713,7 @@ non-important content
|
|||
|
||||
# lambda doesn't work without parens, because the colon
|
||||
# makes the parser think it's a format_spec
|
||||
self.assertAllRaise(SyntaxError, 'unexpected EOF while parsing',
|
||||
self.assertAllRaise(SyntaxError, 'invalid syntax',
|
||||
["f'{lambda x:x}'",
|
||||
])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue