diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-12-08 08:04:49 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-12-08 08:04:49 (GMT) |
commit | f34445f7bd30d3fe1fb9c5a5a87f10225a6372a3 (patch) | |
tree | 14b3fee03792dc52fcde71af82dc9311fea76271 | |
parent | 24a0941a0f36097704afc2936269d6050503af37 (diff) | |
download | cpython-f34445f7bd30d3fe1fb9c5a5a87f10225a6372a3.zip cpython-f34445f7bd30d3fe1fb9c5a5a87f10225a6372a3.tar.gz cpython-f34445f7bd30d3fe1fb9c5a5a87f10225a6372a3.tar.bz2 |
Fix Issue8194 - Fix incompatible API change in the parse_respones for xmlrpclib.
-rw-r--r-- | Lib/xmlrpc/client.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py index 4de4c2b..19d4d69 100644 --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -1297,8 +1297,12 @@ class Transport: 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 |