gh-105915: Add 'r' prefix to not emit SyntaxWarning in test_fstring (#105940)

Co-authored-by: @sunmy2019
This commit is contained in:
Lysandros Nikolaou 2023-06-20 14:49:00 +02:00 committed by GitHub
parent 6586cee27f
commit 4b431d2e90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -773,7 +773,7 @@ x = (
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: