summaryrefslogtreecommitdiff
path: root/Lib/http/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/http/client.py')
-rw-r--r--Lib/http/client.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 97a71559dc..4d93b93ff0 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -511,6 +511,10 @@ class HTTPResponse(io.RawIOBase):
self.length -= len(s)
if not self.length:
self.close()
+ else:
+ if not s:
+ self.close()
+
return s
def _read_chunked(self, amt):