Make Response.content() return None if status_code is None

Fix #3698.
This commit is contained in:
Nicola Soranzo
2016-11-23 21:15:07 +00:00
committed by GitHub
parent ccabcf1fca
commit 4f428228d7
+1 -1
View File
@@ -769,7 +769,7 @@ class Response(object):
raise RuntimeError(
'The content for this response was already consumed')
if self.status_code == 0:
if not self.status_code:
self._content = None
else:
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()