summaryrefslogtreecommitdiff
path: root/Lib/http
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-02-02 23:08:51 +0100
committerAntoine Pitrou <solipsis@pitrou.net>2013-02-02 23:08:51 +0100
commitde59565f297f40571ad964587502561bdbe2282a (patch)
tree6f0b17e9c60aa61371f2f0562a62960584c8447c /Lib/http
parentbeec61ae4e811f55f58d0197c8af994e252ab9ae (diff)
downloadcpython-git-de59565f297f40571ad964587502561bdbe2282a.tar.gz
Simplify code in HTTPResponse.read()
Diffstat (limited to 'Lib/http')
-rw-r--r--Lib/http/client.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 36528dacba..4574eedaf2 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -515,13 +515,10 @@ class HTTPResponse(io.RawIOBase):
# 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