mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Fix improper use of re.escape() in tests. (#4814)
This commit is contained in:
parent
0e069a1597
commit
b748e3b258
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue