Mercurial > cpython-lru_cache-weakref
diff Lib/httplib.py @ 42431:7401ff78eb29
A few local changes for consistency of string literals.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Fri, 03 Aug 2007 20:30:33 +0000 |
| parents | ae72bf5ae465 |
| children | 05728e52b283 |
line wrap: on
line diff
--- a/Lib/httplib.py Fri Aug 03 19:19:24 2007 +0000 +++ b/Lib/httplib.py Fri Aug 03 20:30:33 2007 +0000 @@ -67,6 +67,7 @@ """ import errno +import io import mimetools import socket from urlparse import urlsplit @@ -307,7 +308,7 @@ self.status = self.status + '; bad seek' break -class HTTPResponse: +class HTTPResponse(io.IOBase): # strict: If true, raise BadStatusLine if the status line can't be # parsed as a valid HTTP/1.0 or 1.1 status line. By default it is @@ -897,7 +898,7 @@ self.send(body) def getresponse(self): - "Get the response from the server." + """Get the response from the server.""" # if a prior response has been completed, then forget about it. if self.__response and self.__response.isclosed(): @@ -1032,13 +1033,13 @@ avail = len(self._buf) while size is None or avail < size: s = self._read() - if s == '': + if s == "": break L.append(s) avail += len(s) all = "".join(L) if size is None: - self._buf = '' + self._buf = "" return all else: self._buf = all[size:]
