https://github.com/python/cpython/commit/2d83891dfd51f595de68b0336b3bfc876f7b2507
commit: 2d83891dfd51f595de68b0336b3bfc876f7b2507
branch: main
author: Thomas Grainger <tagr...@gmail.com>
committer: vstinner <vstin...@python.org>
date: 2025-03-26T15:01:18+01:00
summary:

gh-131649: fix test_string_literals SyntaxWarning (#131650)

files:
M Lib/test/test_string_literals.py

diff --git a/Lib/test/test_string_literals.py b/Lib/test/test_string_literals.py
index 9d57233eb0882a..1800b17e1df3d7 100644
--- a/Lib/test/test_string_literals.py
+++ b/Lib/test/test_string_literals.py
@@ -177,7 +177,7 @@ def test_eval_str_invalid_octal_escape(self):
     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 @@ def test_invalid_escape_locations_with_offset(self):
 
         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 '

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to