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