aboutsummaryrefslogtreecommitdiffstats
path: root/netlib
diff options
context:
space:
mode:
Diffstat (limited to 'netlib')
-rw-r--r--netlib/http/http2/protocol.py10
-rw-r--r--netlib/http/semantics.py12
2 files changed, 11 insertions, 11 deletions
diff --git a/netlib/http/http2/protocol.py b/netlib/http/http2/protocol.py
index 896b728b..c2ad5edd 100644
--- a/netlib/http/http2/protocol.py
+++ b/netlib/http/http2/protocol.py
@@ -142,13 +142,13 @@ class HTTP2Protocol(semantics.ProtocolMixin):
headers = request.headers.copy()
- if not ':authority' in headers.keys():
+ if ':authority' not in headers.keys():
headers.add(':authority', bytes(authority), prepend=True)
- if not ':scheme' in headers.keys():
+ if ':scheme' not in headers.keys():
headers.add(':scheme', bytes(request.scheme), prepend=True)
- if not ':path' in headers.keys():
+ if ':path' not in headers.keys():
headers.add(':path', bytes(request.path), prepend=True)
- if not ':method' in headers.keys():
+ if ':method' not in headers.keys():
headers.add(':method', bytes(request.method), prepend=True)
headers = headers.items()
@@ -167,7 +167,7 @@ class HTTP2Protocol(semantics.ProtocolMixin):
headers = response.headers.copy()
- if not ':status' in headers.keys():
+ if ':status' not in headers.keys():
headers.add(':status', bytes(str(response.status_code)), prepend=True)
headers = headers.items()
diff --git a/netlib/http/semantics.py b/netlib/http/semantics.py
index d9dbb559..76213cd1 100644
--- a/netlib/http/semantics.py
+++ b/netlib/http/semantics.py
@@ -15,10 +15,10 @@ CONTENT_MISSING = 0
class ProtocolMixin(object):
def read_request(self, *args, **kwargs): # pragma: no cover
- raise NotImplemented
+ raise NotImplementedError
def read_response(self, *args, **kwargs): # pragma: no cover
- raise NotImplemented
+ raise NotImplementedError
def assemble(self, message):
if isinstance(message, Request):
@@ -28,11 +28,11 @@ class ProtocolMixin(object):
else:
raise ValueError("HTTP message not supported.")
- def assemble_request(self, request): # pragma: no cover
- raise NotImplemented
+ def assemble_request(self, *args, **kwargs): # pragma: no cover
+ raise NotImplementedError
- def assemble_response(self, response): # pragma: no cover
- raise NotImplemented
+ def assemble_response(self, *args, **kwargs): # pragma: no cover
+ raise NotImplementedError
class Request(object):