From a6c608e08595e95279713e51e2a346344bd290c0 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 23 Nov 2016 01:27:23 +0100 Subject: [PATCH] make the new mypy release happy --- mitmproxy/proxy/protocol/http.py | 5 +++++ mitmproxy/proxy/protocol/http2.py | 5 +++++ tox.ini | 1 + 3 files changed, 11 insertions(+) diff --git a/mitmproxy/proxy/protocol/http.py b/mitmproxy/proxy/protocol/http.py index ac410eebd..dcedfc5a6 100644 --- a/mitmproxy/proxy/protocol/http.py +++ b/mitmproxy/proxy/protocol/http.py @@ -3,6 +3,7 @@ import time import traceback import enum +from mitmproxy import connections # noqa from mitmproxy import exceptions from mitmproxy import http from mitmproxy import flow @@ -146,6 +147,10 @@ def validate_request_form(mode, request): class HttpLayer(base.Layer): + if False: + # mypy type hints + server_conn = None # type: connections.ServerConnection + def __init__(self, ctx, mode): super().__init__(ctx) self.mode = mode diff --git a/mitmproxy/proxy/protocol/http2.py b/mitmproxy/proxy/protocol/http2.py index 5ab503f54..835f86d00 100644 --- a/mitmproxy/proxy/protocol/http2.py +++ b/mitmproxy/proxy/protocol/http2.py @@ -9,6 +9,7 @@ from h2 import connection from h2 import events import queue +from mitmproxy import connections # noqa from mitmproxy import exceptions from mitmproxy import http from mitmproxy.proxy.protocol import base @@ -82,6 +83,10 @@ class SafeH2Connection(connection.H2Connection): class Http2Layer(base.Layer): + if False: + # mypy type hints + client_conn = None # type: connections.ClientConnection + def __init__(self, ctx, mode: str) -> None: super().__init__(ctx) self.mode = mode diff --git a/tox.ini b/tox.ini index 80e223898..5d881ca9f 100644 --- a/tox.ini +++ b/tox.ini @@ -27,4 +27,5 @@ commands = mitmproxy/addons \ mitmproxy/addonmanager.py \ mitmproxy/proxy/protocol/ \ + mitmproxy/log.py \ mitmproxy/tools/dump.py mitmproxy/tools/web