Skip to content

Commit 5bcb476

Browse files
[3.13] gh-131649: fix test_string_literals SyntaxWarning (GH-131650) (#131766)
(cherry picked from commit 2d83891) Co-authored-by: Thomas Grainger <[email protected]>
1 parent 28d0286 commit 5bcb476

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_string_literals.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def test_invalid_escape_locations_with_offset(self):
172172
with warnings.catch_warnings(record=True) as w:
173173
warnings.simplefilter('error', category=SyntaxWarning)
174174
with self.assertRaises(SyntaxError) as cm:
175-
eval("\"'''''''''''''''''''''invalid\ Escape\"")
175+
eval("\"'''''''''''''''''''''invalid\\ Escape\"")
176176
exc = cm.exception
177177
self.assertEqual(w, [])
178178
self.assertEqual(exc.msg, r"invalid escape sequence '\ '")
@@ -183,7 +183,7 @@ def test_invalid_escape_locations_with_offset(self):
183183
with warnings.catch_warnings(record=True) as w:
184184
warnings.simplefilter('error', category=SyntaxWarning)
185185
with self.assertRaises(SyntaxError) as cm:
186-
eval("\"''Incorrect \ logic?\"")
186+
eval("\"''Incorrect \\ logic?\"")
187187
exc = cm.exception
188188
self.assertEqual(w, [])
189189
self.assertEqual(exc.msg, r"invalid escape sequence '\ '")

0 commit comments

Comments
 (0)