]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-105915: Add 'r' prefix to not emit SyntaxWarning in test_fstring (GH-105940...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 20 Jun 2023 13:16:21 +0000 (06:16 -0700)
committerGitHub <noreply@github.com>
Tue, 20 Jun 2023 13:16:21 +0000 (13:16 +0000)
(cherry picked from commit 4b431d2e90bf5760a57aa40af2dd78e7bbf0b1ae)

Co-authored-by: @sunmy2019
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Lib/test/test_fstring.py

index ad5ac6a2f0432ef7a7051a8e7975480394d9d5c8..1eb3bfb41888c20839806bec07bd408551453790 100644 (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: