diff --git a/Lib/http/client.py b/Lib/http/client.py index 36528dacba7..4574eedaf2a 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -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