aboutsummaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2017-12-12 10:29:05 -0800
committerSerhiy Storchaka <storchaka@gmail.com>2017-12-12 20:29:05 +0200
commitf4b814f9a23287716493a612e041f7cd4ea297ac (patch)
tree1f84a00e0603bad5f9ca56cc76b58a5a126bf51d /Lib
parentFix implementation dependent assertion in test_plistlib. (GH-4813) (#4815) (diff)
downloadcpython-f4b814f9a23287716493a612e041f7cd4ea297ac.tar.gz
cpython-f4b814f9a23287716493a612e041f7cd4ea297ac.tar.bz2
cpython-f4b814f9a23287716493a612e041f7cd4ea297ac.zip
Fix improper use of re.escape() in tests. (GH-4814) (#4816)
(cherry picked from commit b748e3b2586e44bfc7011b601bce9cc6d16d89f1)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_re.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index e23e5a9a6ca..2b74373ffae 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -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')