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

(cherry picked from commit b748e3b258)
This commit is contained in:
Miss Islington (bot) 2017-12-12 10:29:05 -08:00 committed by Serhiy Storchaka
parent eb2f222aae
commit f4b814f9a2
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,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)', r'\g<a>\g<a>', 'xx'), 'xxxx')