Commit de59565f authored by Antoine Pitrou's avatar Antoine Pitrou

Simplify code in HTTPResponse.read()

parent beec61ae
......@@ -515,13 +515,10 @@ class HTTPResponse(io.RawIOBase):
# Ideally, we would raise IncompleteRead if the content-length
# wasn't satisfied, but it might break compatibility.
self.close()
if self.length is not None:
elif self.length is not None:
self.length -= len(s)
if not self.length:
self.close()
else:
if not s:
self.close()
return s
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment