aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-06-01 14:43:08 +1200
committerAldo Cortesi <aldo@nullcube.com>2016-06-01 14:43:08 +1200
commitafcfa783ea31ac98e6137cc983ae3dfeb645a054 (patch)
treef74f79b37e951097a1bf080f0e1239b4144900ed
parent0a2e7a97cdfe3e786ada3db8940c7228644e958a (diff)
downloadmitmproxy-afcfa783ea31ac98e6137cc983ae3dfeb645a054.tar.gz
mitmproxy-afcfa783ea31ac98e6137cc983ae3dfeb645a054.tar.bz2
mitmproxy-afcfa783ea31ac98e6137cc983ae3dfeb645a054.zip
Satisfy lint
-rw-r--r--mitmproxy/protocol/http.py4
-rw-r--r--mitmproxy/protocol/http2.py1
-rw-r--r--mitmproxy/protocol/tls.py6
-rw-r--r--mitmproxy/proxy/root_context.py2
-rw-r--r--mitmproxy/proxy/server.py1
5 files changed, 8 insertions, 6 deletions
diff --git a/mitmproxy/protocol/http.py b/mitmproxy/protocol/http.py
index eb740e3b..ae03ab7f 100644
--- a/mitmproxy/protocol/http.py
+++ b/mitmproxy/protocol/http.py
@@ -80,7 +80,7 @@ class ConnectServerConnection(object):
__nonzero__ = __bool__
-class UpstreamConnectLayer(Layer):
+class UpstreamConnectLayer(base.Layer):
def __init__(self, ctx, connect_request):
super(UpstreamConnectLayer, self).__init__(ctx)
@@ -120,7 +120,7 @@ class UpstreamConnectLayer(Layer):
self.server_conn.address = address
-class HttpLayer(Layer):
+class HttpLayer(base.Layer):
def __init__(self, ctx, mode):
super(HttpLayer, self).__init__(ctx)
diff --git a/mitmproxy/protocol/http2.py b/mitmproxy/protocol/http2.py
index 0fa4d77b..9fc409a2 100644
--- a/mitmproxy/protocol/http2.py
+++ b/mitmproxy/protocol/http2.py
@@ -18,7 +18,6 @@ from mitmproxy import protocol
from netlib import http
from netlib import tcp
from netlib.http import http2
-from netlib.http import url
class SafeH2Connection(connection.H2Connection):
diff --git a/mitmproxy/protocol/tls.py b/mitmproxy/protocol/tls.py
index 0bbb2cc2..9f883b2b 100644
--- a/mitmproxy/protocol/tls.py
+++ b/mitmproxy/protocol/tls.py
@@ -302,8 +302,10 @@ class TlsClientHello(object):
try:
return cls(raw_client_hello)
except construct.ConstructError as e:
- raise exceptions.TlsProtocolException('Cannot parse Client Hello: %s, Raw Client Hello: %s' %
- (repr(e), raw_client_hello.encode("hex")))
+ raise exceptions.TlsProtocolException(
+ 'Cannot parse Client Hello: %s, Raw Client Hello: %s' %
+ (repr(e), raw_client_hello.encode("hex"))
+ )
def __repr__(self):
return "TlsClientHello( sni: %s alpn_protocols: %s, cipher_suites: %s)" % \
diff --git a/mitmproxy/proxy/root_context.py b/mitmproxy/proxy/root_context.py
index 6a4162df..57183c7e 100644
--- a/mitmproxy/proxy/root_context.py
+++ b/mitmproxy/proxy/root_context.py
@@ -48,7 +48,7 @@ class RootContext(object):
def _next_layer(self, top_layer):
try:
d = top_layer.client_conn.rfile.peek(3)
- except netlib.exceptions.TcpException as e:
+ except netlib.exceptions.TcpException as e:
six.reraise(exceptions.ProtocolException, exceptions.ProtocolException(str(e)), sys.exc_info()[2])
client_tls = protocol.is_tls_record_magic(d)
diff --git a/mitmproxy/proxy/server.py b/mitmproxy/proxy/server.py
index 933d043d..7e96911a 100644
--- a/mitmproxy/proxy/server.py
+++ b/mitmproxy/proxy/server.py
@@ -14,6 +14,7 @@ from mitmproxy.proxy import root_context
from netlib import tcp
from netlib.http import http1
+
class DummyServer:
bound = False