update comments

This commit is contained in:
Matthew Shao 2016-03-26 17:49:22 +08:00
parent 53e15f778d
commit 66bd27e6f9
3 changed files with 7 additions and 7 deletions

View File

@ -225,7 +225,7 @@ class HTTPResponse(MessageMixin, Response):
headers: Headers object
content: Content of the request, the value is None if there is content
content: Content of the response, the value is None if there is content
associated, but not present.
timestamp_start: Timestamp indicating when request transmission started

View File

@ -50,8 +50,8 @@ class _HttpTransmissionLayer(Layer):
yield "this is a generator" # pragma: no cover
def send_response(self, response):
if response.content == None:
raise HttpException("Cannot assemble flow with None content")
if response.content is None:
raise HttpException("Cannot assemble flow with missing content")
self.send_response_headers(response)
self.send_response_body(response, [response.content])

View File

@ -5,8 +5,8 @@ import itertools
from ...exceptions import HttpException
def assemble_request(request):
if request.content == None:
raise HttpException("Cannot assemble flow with None content")
if request.content is None:
raise HttpException("Cannot assemble flow with missing content")
head = assemble_request_head(request)
body = b"".join(assemble_body(request.data.headers, [request.data.content]))
return head + body
@ -19,8 +19,8 @@ def assemble_request_head(request):
def assemble_response(response):
if response.content == None:
raise HttpException("Cannot assemble flow with None content")
if response.content is None:
raise HttpException("Cannot assemble flow with missing content")
head = assemble_response_head(response)
body = b"".join(assemble_body(response.data.headers, [response.data.content]))
return head + body