Mercurial > cpython-lru_cache-weakref
diff Lib/xmlrpc/client.py @ 66790:c718cb786aeb
Fix Issue8194 - Fix incompatible API change in the parse_respones for xmlrpclib.
| author | Senthil Kumaran <orsenthil@gmail.com> |
|---|---|
| date | Wed, 08 Dec 2010 08:04:49 +0000 |
| parents | 932a3ffa4e56 |
| children | 3c9232a684ae |
line wrap: on
line diff
--- a/Lib/xmlrpc/client.py Wed Dec 08 06:50:02 2010 +0000 +++ b/Lib/xmlrpc/client.py Wed Dec 08 08:04:49 2010 +0000 @@ -1297,8 +1297,12 @@ def parse_response(self, response): # read response data from httpresponse, and parse it - if response.getheader("Content-Encoding", "") == "gzip": - stream = GzipDecodedResponse(response) + # Check for new http response object, otherwise it is a file object. + if hasattr(response, 'getheader'): + if response.getheader("Content-Encoding", "") == "gzip": + stream = GzipDecodedResponse(response) + else: + stream = response else: stream = response
