summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2017-04-04 12:51:48 -0400
committerNed Batchelder <ned@nedbatchelder.com>2017-04-04 12:51:48 -0400
commite9ef845fd2f3c849485dacfe1f8070cbffe957b5 (patch)
tree39f7d2640f502bc130a5eea435083d36fa8fa8d7
parent0d82f5f090da94e4eafc83cb4cfacc2d90fc5e74 (diff)
downloadpython-coveragepy-git-e9ef845fd2f3c849485dacfe1f8070cbffe957b5.tar.gz
Properly escape the replacement string for re.sub
-rw-r--r--tests/test_farm.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_farm.py b/tests/test_farm.py
index 6f38e5b4..1b52bc29 100644
--- a/tests/test_farm.py
+++ b/tests/test_farm.py
@@ -344,7 +344,7 @@ def scrub(strdata, scrubs):
"""
for rgx_find, rgx_replace in scrubs:
- strdata = re.sub(rgx_find, re.escape(rgx_replace), strdata)
+ strdata = re.sub(rgx_find, rgx_replace.replace("\\", "\\\\"), strdata)
return strdata