diff options
author | Lysandros Nikolaou <lisandrosnik@gmail.com> | 2020-04-15 18:22:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 18:22:10 (GMT) |
commit | 9a4b38f66b3e674db94e07980e1cacb39e388c73 (patch) | |
tree | b8046dd0e0b7b9bf0e3592b88c9dc0cd2c7f7ae5 /Lib/test/test_fstring.py | |
parent | 574547a75c79b506261520c5773ae08a1dcea1b9 (diff) | |
download | cpython-9a4b38f66b3e674db94e07980e1cacb39e388c73.zip cpython-9a4b38f66b3e674db94e07980e1cacb39e388c73.tar.gz cpython-9a4b38f66b3e674db94e07980e1cacb39e388c73.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_fstring.py')
-rw-r--r-- | Lib/test/test_fstring.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index 8fd7cf0..fe465b7 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -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}'", ]) |