Commit d663549a authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by Serhiy Storchaka

Fix improper use of re.escape() in tests. (GH-4814) (#4817)

(cherry picked from commit b748e3b2)
parent 3b9173d3
......@@ -58,7 +58,7 @@ class ReTests(unittest.TestCase):
s = r"\1\1"
self.assertEqual(re.sub('(.)', s, 'x'), 'xx')
self.assertEqual(re.sub('(.)', re.escape(s), 'x'), s)
self.assertEqual(re.sub('(.)', s.replace('\\', r'\\'), 'x'), s)
self.assertEqual(re.sub('(.)', lambda m: s, 'x'), s)
self.assertEqual(re.sub('(?P<a>x)', '\g<a>\g<a>', 'xx'), 'xxxx')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment