Skip to content

Commit

Permalink
pythongh-105915: Add 'r' prefix to not emit SyntaxWarning in test_fst…
Browse files Browse the repository at this point in the history
…ring (python#105940)

Co-authored-by: @sunmy2019
  • Loading branch information
lysnikolaou authored Jun 20, 2023
1 parent 6586cee commit 4b431d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_fstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def __format__(self, format_spec):
self.assertEqual(f'{CustomFormat():\n}', '\n')
self.assertEqual(f'{CustomFormat():\u2603}', '☃')
with self.assertWarns(SyntaxWarning):
exec('f"{F():¯\_(ツ)_/¯}"', {'F': CustomFormat})
exec(r'f"{F():¯\_(ツ)_/¯}"', {'F': CustomFormat})

def test_side_effect_order(self):
class X:
Expand Down

0 comments on commit 4b431d2

Please sign in to comment.