summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2015-04-25 08:43:13 -0500
committerIan Cordasco <graffatcolmingov@gmail.com>2015-04-25 08:43:14 -0500
commitb06e1b72643255250c752286f502e93efee80e7c (patch)
treeca8142e769c233259a265b951f8b87c9a1479878
parent563f0e8b7a3e32f034cbf41474ad25cff2fccbbd (diff)
downloadurllib3-b06e1b72643255250c752286f502e93efee80e7c.tar.gz
Simplify a couple conditions
There were two conditions added that could be simplified into additive conditionals. This is more cosmetic than anything else.
-rw-r--r--urllib3/response.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/urllib3/response.py b/urllib3/response.py
index 9b262efd..79a5e789 100644
--- a/urllib3/response.py
+++ b/urllib3/response.py
@@ -133,9 +133,8 @@ class HTTPResponse(io.IOBase):
self.chunked = True
# We certainly don't want to preload content when the response is chunked.
- if not self.chunked:
- if preload_content and not self._body:
- self._body = self.read(decode_content=decode_content)
+ if not self.chunked and preload_content and not self._body:
+ self._body = self.read(decode_content=decode_content)
def get_redirect_location(self):
"""
@@ -181,9 +180,8 @@ class HTTPResponse(io.IOBase):
# Note: content-encoding value should be case-insensitive, per RFC 7230
# Section 3.2
content_encoding = self.headers.get('content-encoding', '').lower()
- if self._decoder is None:
- if content_encoding in self.CONTENT_DECODERS:
- self._decoder = _get_decoder(content_encoding)
+ if self._decoder is None and content_encoding in self.CONTENT_DECODERS:
+ self._decoder = _get_decoder(content_encoding)
def _decode(self, data, decode_content, flush_decoder):
"""