mirror of https://github.com/python/cpython.git
Simplify code in HTTPResponse.read()
This commit is contained in:
parent
beec61ae4e
commit
de59565f29
|
@ -515,13 +515,10 @@ def read(self, amt=None):
|
|||
# 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
|
||||
|
||||
|
|
Loading…
Reference in New Issue