From: Antoine Pitrou Date: Sat, 2 Feb 2013 22:08:51 +0000 (+0100) Subject: Simplify code in HTTPResponse.read() X-Git-Tag: v3.2.4rc1~152 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de59565f297f40571ad964587502561bdbe2282a;p=thirdparty%2FPython%2Fcpython.git Simplify code in HTTPResponse.read() --- diff --git a/Lib/http/client.py b/Lib/http/client.py index 36528dacba7a..4574eedaf2a8 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