From: Thomas Grainger Date: Wed, 26 Mar 2025 14:01:18 +0000 (+0000) Subject: gh-131649: fix test_string_literals SyntaxWarning (#131650) X-Git-Tag: v3.14.0a7~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d83891dfd51f595de68b0336b3bfc876f7b2507;p=thirdparty%2FPython%2Fcpython.git gh-131649: fix test_string_literals SyntaxWarning (#131650) --- diff --git a/Lib/test/test_string_literals.py b/Lib/test/test_string_literals.py index 9d57233eb088..1800b17e1df3 100644 --- a/Lib/test/test_string_literals.py +++ b/Lib/test/test_string_literals.py @@ -177,7 +177,7 @@ class TestLiterals(unittest.TestCase): def test_invalid_escape_locations_with_offset(self): with warnings.catch_warnings(record=True) as w: warnings.simplefilter('always', category=SyntaxWarning) - eval("\"'''''''''''''''''''''invalid\ Escape\"") + eval("\"'''''''''''''''''''''invalid\\ Escape\"") self.assertEqual(len(w), 1) self.assertEqual(str(w[0].message), r'"\ " is an invalid escape sequence. Such sequences ' @@ -188,7 +188,7 @@ class TestLiterals(unittest.TestCase): with warnings.catch_warnings(record=True) as w: warnings.simplefilter('always', category=SyntaxWarning) - eval("\"''Incorrect \ logic?\"") + eval("\"''Incorrect \\ logic?\"") self.assertEqual(len(w), 1) self.assertEqual(str(w[0].message), r'"\ " is an invalid escape sequence. Such sequences '