Mercurial > cpython-lru_cache-weakref
diff Lib/http/client.py @ 81953:41d2c18abbf4 3.2
Simplify code in HTTPResponse.read()
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Sat, 02 Feb 2013 23:08:51 +0100 |
| parents | 03c536afeb7e |
| children | 6cc5bbfcf04e 98f7aaa005e6 |
line wrap: on
line diff
--- a/Lib/http/client.py Sat Feb 02 22:49:34 2013 +0100 +++ b/Lib/http/client.py Sat Feb 02 23:08:51 2013 +0100 @@ -515,13 +515,10 @@ # 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
