diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2017-04-04 12:51:48 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2017-04-04 12:51:48 -0400 |
commit | 4d1c9410becf12fc765b9184d33cd43023e66da4 (patch) | |
tree | 499ee76ae28333d73aba020b2909afc5334daf7f | |
parent | a0d7920455a7844fecd97180256c9d6242fb5a14 (diff) | |
download | python-coveragepy-4d1c9410becf12fc765b9184d33cd43023e66da4.tar.gz |
Properly escape the replacement string for re.sub
-rw-r--r-- | tests/test_farm.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_farm.py b/tests/test_farm.py index 6f38e5b..1b52bc2 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 |