type -> isinstance

This commit is contained in:
Raphael Deem 2016-12-17 21:15:20 -08:00
parent 7e6c92dc52
commit 00b5a496dd

View File

@ -97,9 +97,10 @@ class HTTPResponse:
headers = b''
if self.headers:
headers = b''.join(
b'%b: %b\r\n' % (name.encode(), str(value).encode('utf-8'))
if type(value) != Cookie else
b'%b: %b\r\n' % (name.encode(), value.encode('utf-8'))
if isinstance(value, str) or isinstance(value, Cookie)
else b'%b: %b\r\n' % (name.encode(),
str(value).encode('utf-8'))
for name, value in self.headers.items()
)