Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #3698.

authored by Nicola Soranzo · committed by GitHub · parent ccabcf1 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:requests/models.py+1 added-1 removed
767 unmodified lines
768 if self._content_consumed:769 raise RuntimeError(770 'The content for this response was already consumed')771772 if self.status_code == 0:772 if not self.status_code:773 self._content = None774 else:775 self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()776
124 unmodified lines