mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
bpo-42986: Fix parser crash when reporting syntax errors in f-string with newlines (GH-24279)
This commit is contained in:
parent
a1e9a1e120
commit
4090151816
3 changed files with 6 additions and 1 deletions
|
|
@ -664,6 +664,9 @@ x = (
|
|||
self.assertAllRaise(SyntaxError, 'unterminated string literal',
|
||||
["f'{\n}'",
|
||||
])
|
||||
def test_newlines_before_syntax_error(self):
|
||||
self.assertAllRaise(SyntaxError, "invalid syntax",
|
||||
["f'{.}'", "\nf'{.}'", "\n\nf'{.}'"])
|
||||
|
||||
def test_backslashes_in_string_part(self):
|
||||
self.assertEqual(f'\t', '\t')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue