Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! fixup! gh-105194: Fix format specifier escaped characters in f…
…-strings
  • Loading branch information
pablogsal committed Jun 2, 2023
commit fd297bdecca28adc01b2deb42ba9f4a7651de777
4 changes: 2 additions & 2 deletions Lib/test/test_fstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,12 +763,12 @@ def test_format_specifier_expressions(self):
# the : or ! itself.
"""f'{"s"!{"r"}}'""",
])

def test_custom_format_specifier(self):
class CustomFormat:
def __format__(self, format_spec):
return format_spec

self.assertEqual(f'{CustomFormat():\n}', '\n')
self.assertEqual(f'{CustomFormat():\u2603}', '☃')
with self.assertWarns(SyntaxWarning):
Expand Down