diff options
| author | Aldo Cortesi <aldo@corte.si> | 2018-04-16 07:35:20 +1200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-16 07:35:20 +1200 |
| commit | 5f74adc2df6d2a9452a9e3a6923fe05ba579e9e6 (patch) | |
| tree | f1ba68e2dd5bcf6b673a32d91b468d767da86cdf /examples/complex/har_dump.py | |
| parent | 865a373bd34589543e381f1de2f4b46740965d7e (diff) | |
| parent | 0e984e1442e735a6a3cee5170bead492b231d620 (diff) | |
| download | mitmproxy-5f74adc2df6d2a9452a9e3a6923fe05ba579e9e6.tar.gz mitmproxy-5f74adc2df6d2a9452a9e3a6923fe05ba579e9e6.tar.bz2 mitmproxy-5f74adc2df6d2a9452a9e3a6923fe05ba579e9e6.zip | |
Merge pull request #3059 from obscure76/enh/issue-3053
fix Python 3.6 variable type annotations #3053
Diffstat (limited to 'examples/complex/har_dump.py')
| -rw-r--r-- | examples/complex/har_dump.py | 8 |
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) |
