From: Lysandros Nikolaou Date: Tue, 20 Jun 2023 12:49:00 +0000 (+0200) Subject: gh-105915: Add 'r' prefix to not emit SyntaxWarning in test_fstring (#105940) X-Git-Tag: v3.13.0a1~1692 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4b431d2e90bf5760a57aa40af2dd78e7bbf0b1ae;p=thirdparty%2FPython%2Fcpython.git gh-105915: Add 'r' prefix to not emit SyntaxWarning in test_fstring (#105940) Co-authored-by: @sunmy2019 --- diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index ad5ac6a2f043..1eb3bfb41888 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -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: