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')
does not physically exist */
assert(p->tok->fp == NULL || p->tok->fp == stdin || p->tok->done == E_EOF);
- if (p->tok->lineno == lineno) {
+ if (p->tok->lineno <= lineno) {
Py_ssize_t size = p->tok->inp - p->tok->buf;
error_line = PyUnicode_DecodeUTF8(p->tok->buf, size, "replace");
}