Skip to content

Commit

Permalink
Fix improper use of re.escape() in tests. (#4814)
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka committed Dec 12, 2017
1 parent 0e069a1 commit b748e3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_re.py
Expand Up @@ -109,7 +109,7 @@ def test_basic_re_sub(self):

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')
Expand Down

0 comments on commit b748e3b

Please sign in to comment.