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/platform | |
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/platform')
-rw-r--r-- | mitmproxy/platform/pf.py | 2 | ||||
-rw-r--r-- | mitmproxy/platform/windows.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/mitmproxy/platform/pf.py b/mitmproxy/platform/pf.py index bb5eb515..5e22ec31 100644 --- a/mitmproxy/platform/pf.py +++ b/mitmproxy/platform/pf.py @@ -11,7 +11,7 @@ def lookup(address, port, s): """ # We may get an ipv4-mapped ipv6 address here, e.g. ::ffff:127.0.0.1. # Those still appear as "127.0.0.1" in the table, so we need to strip the prefix. - address = re.sub("^::ffff:(?=\d+.\d+.\d+.\d+$)", "", address) + address = re.sub(r"^::ffff:(?=\d+.\d+.\d+.\d+$)", "", address) s = s.decode() spec = "%s:%s" % (address, port) for i in s.split("\n"): diff --git a/mitmproxy/platform/windows.py b/mitmproxy/platform/windows.py index b849afa5..cb0a7096 100644 --- a/mitmproxy/platform/windows.py +++ b/mitmproxy/platform/windows.py @@ -58,7 +58,7 @@ class Resolver: def original_addr(self, csock: socket.socket): ip, port = csock.getpeername()[:2] - ip = re.sub("^::ffff:(?=\d+.\d+.\d+.\d+$)", "", ip) + ip = re.sub(r"^::ffff:(?=\d+.\d+.\d+.\d+$)", "", ip) ip = ip.split("%", 1)[0] with self.lock: try: |