aboutsummaryrefslogtreecommitdiffstats
path: root/examples/complex/har_dump.py
diff options
context:
space:
mode:
authoroscure76 <midhun.nitw@gmail.com>2018-04-14 16:24:41 -0700
committeroscure76 <midhun.nitw@gmail.com>2018-04-14 16:24:41 -0700
commit0e984e1442e735a6a3cee5170bead492b231d620 (patch)
tree4e0ae4b5598f3c1be35a38819b15a12ace6209c8 /examples/complex/har_dump.py
parent5eb17bbf6d47c8d703763bfa41cf1ff3f98a632f (diff)
downloadmitmproxy-0e984e1442e735a6a3cee5170bead492b231d620.tar.gz
mitmproxy-0e984e1442e735a6a3cee5170bead492b231d620.tar.bz2
mitmproxy-0e984e1442e735a6a3cee5170bead492b231d620.zip
fix Python 3.6 variable type annotations #3053
Diffstat (limited to 'examples/complex/har_dump.py')
-rw-r--r--examples/complex/har_dump.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/complex/har_dump.py b/examples/complex/har_dump.py
index 9e287a19..040c7d28 100644
--- a/examples/complex/har_dump.py
+++ b/examples/complex/har_dump.py
@@ -20,11 +20,11 @@ from mitmproxy import ctx
from mitmproxy.utils import strutils
from mitmproxy.net.http import cookies
-HAR = {} # type: typing.Dict
+HAR: typing.Dict = {}
# A list of server seen till now is maintained so we can avoid
# using 'connect' time for entries that use an existing connection.
-SERVERS_SEEN = set() # type: typing.Set[connections.ServerConnection]
+SERVERS_SEEN: typing.Set[connections.ServerConnection] = set()
def load(l):
@@ -155,12 +155,12 @@ def done():
Called once on script shutdown, after any other events.
"""
if ctx.options.hardump:
- json_dump = json.dumps(HAR, indent=2) # type: str
+ json_dump: str = json.dumps(HAR, indent=2)
if ctx.options.hardump == '-':
mitmproxy.ctx.log(json_dump)
else:
- raw = json_dump.encode() # type: bytes
+ raw: bytes = json_dump.encode()
if ctx.options.hardump.endswith('.zhar'):
raw = zlib.compress(raw, 9)