diff options
author | oscure76 <midhun.nitw@gmail.com> | 2018-04-14 16:24:41 -0700 |
---|---|---|
committer | oscure76 <midhun.nitw@gmail.com> | 2018-04-14 16:24:41 -0700 |
commit | 0e984e1442e735a6a3cee5170bead492b231d620 (patch) | |
tree | 4e0ae4b5598f3c1be35a38819b15a12ace6209c8 /mitmproxy/io | |
parent | 5eb17bbf6d47c8d703763bfa41cf1ff3f98a632f (diff) | |
download | mitmproxy-0e984e1442e735a6a3cee5170bead492b231d620.tar.gz mitmproxy-0e984e1442e735a6a3cee5170bead492b231d620.tar.bz2 mitmproxy-0e984e1442e735a6a3cee5170bead492b231d620.zip |
fix Python 3.6 variable type annotations #3053
Diffstat (limited to 'mitmproxy/io')
-rw-r--r-- | mitmproxy/io/compat.py | 4 | ||||
-rw-r--r-- | mitmproxy/io/io.py | 4 | ||||
-rw-r--r-- | mitmproxy/io/tnetstring.py | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/mitmproxy/io/compat.py b/mitmproxy/io/compat.py index 231fa3b8..cddb8b01 100644 --- a/mitmproxy/io/compat.py +++ b/mitmproxy/io/compat.py @@ -127,8 +127,8 @@ def convert_300_4(data): return data -client_connections = {} # type: Mapping[str, str] -server_connections = {} # type: Mapping[str, str] +client_connections: Mapping[str, str] = {} +server_connections: Mapping[str, str] = {} def convert_4_5(data): diff --git a/mitmproxy/io/io.py b/mitmproxy/io/io.py index 50e26f49..01f1e884 100644 --- a/mitmproxy/io/io.py +++ b/mitmproxy/io/io.py @@ -11,11 +11,11 @@ from mitmproxy import websocket from mitmproxy.io import compat from mitmproxy.io import tnetstring -FLOW_TYPES = dict( +FLOW_TYPES: Dict[str, Type[flow.Flow]] = dict( http=http.HTTPFlow, websocket=websocket.WebSocketFlow, tcp=tcp.TCPFlow, -) # type: Dict[str, Type[flow.Flow]] +) class FlowWriter: diff --git a/mitmproxy/io/tnetstring.py b/mitmproxy/io/tnetstring.py index 82c92f33..aa1f5670 100644 --- a/mitmproxy/io/tnetstring.py +++ b/mitmproxy/io/tnetstring.py @@ -53,7 +53,7 @@ def dumps(value: TSerializable) -> bytes: # This uses a deque to collect output fragments in reverse order, # then joins them together at the end. It's measurably faster # than creating all the intermediate strings. - q = collections.deque() # type: collections.deque + q: collections.deque = collections.deque() _rdumpq(q, 0, value) return b''.join(q) |