summaryrefslogtreecommitdiff
path: root/Lib/httplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 8dbe8a07e4..dca9eca777 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -530,7 +530,8 @@ class HTTPResponse:
s = self.fp.read(amt)
if self.length is not None:
self.length -= len(s)
-
+ if not self.length:
+ self.close()
return s
def _read_chunked(self, amt):