Open felixonmars opened 5 years ago
The generated test_fstring.py became SyntaxError:
File "test_fstring.py", line 534
self.assertEqual(f'{"eric\'s"}', "eric's")
^
SyntaxError: f-string expression part cannot include a backslash
The correct source is:
self.assertEqual(f"{'''eric's'''}", "eric's")
Generated srcdmp seems to be correct:
Expr(
value=Call(func=Attribute(value=Name(id='self'), attr='assertEqual'),
args=[
JoinedStr(
values=[FormattedValue(value=Str(s="eric's"), conversion=-1, format_spec=None)]),
Str(s="eric's")],
keywords=[])),
Thanks for the report. This looks like the same case as reported at https://bugs.python.org/issue28002#msg341512.
Turns out python's fstring test still failed to round trip after the fstring fixes.