Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/test/test_fstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,8 @@ def __repr__(self):
self.assertEqual(f'{C()=:x}', 'C()=FORMAT-x')
self.assertEqual(f'{C()=!r:*^20}', 'C()=********REPR********')

self.assertRaises(SyntaxError, eval, "f'{C=]'")

def test_walrus(self):
x = 20
# This isn't an assignment expression, it's 'x', with a format
Expand Down
1 change: 0 additions & 1 deletion Python/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -5283,7 +5283,6 @@ fstring_find_expr(const char **str, const char *end, int raw, int recurse_lvl,
/* Falls through to error. */

error:
Py_XDECREF(expr_text);
return -1;

}
Expand Down