diff options
author | Mickaël Schoentgen <contact@tiger-222.fr> | 2019-01-05 23:20:39 +0100 |
---|---|---|
committer | Mickaël Schoentgen <contact@tiger-222.fr> | 2019-01-05 23:37:48 +0100 |
commit | 3a2d7bb119828613f2a40b936b1a4d5c40125ccb (patch) | |
tree | 4bad85cba8497e3c5fbfe2fb95c2ea50b6639a2e /mitmproxy/utils | |
parent | 889987aa0a7f4852758ed09f70fe5d30f733a6d3 (diff) | |
download | mitmproxy-3a2d7bb119828613f2a40b936b1a4d5c40125ccb.tar.gz mitmproxy-3a2d7bb119828613f2a40b936b1a4d5c40125ccb.tar.bz2 mitmproxy-3a2d7bb119828613f2a40b936b1a4d5c40125ccb.zip |
Fix several DeprecationWarning: invalid escape sequence
Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
Diffstat (limited to 'mitmproxy/utils')
-rw-r--r-- | mitmproxy/utils/strutils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mitmproxy/utils/strutils.py b/mitmproxy/utils/strutils.py index 71d1c54c..388c765f 100644 --- a/mitmproxy/utils/strutils.py +++ b/mitmproxy/utils/strutils.py @@ -169,7 +169,7 @@ def split_special_areas( >>> split_special_areas( >>> "test /* don't modify me */ foo", - >>> [r"/\*[\s\S]*?\*/"]) # (regex matching comments) + >>> [r"/\\*[\\s\\S]*?\\*/"]) # (regex matching comments) ["test ", "/* don't modify me */", " foo"] "".join(split_special_areas(x, ...)) == x always holds true. @@ -201,7 +201,7 @@ def escape_special_areas( >>> x = escape_special_areas(x, "{", ["'" + SINGLELINE_CONTENT + "'"]) >>> print(x) if (true) { console.log('�}'); } - >>> x = re.sub(r"\s*{\s*", " {\n ", x) + >>> x = re.sub(r"\\s*{\\s*", " {\n ", x) >>> x = unescape_special_areas(x) >>> print(x) if (true) { |