Fix Issue8194 - Fix incompatible API change in the parse_respones for xmlrpclib.

This commit is contained in:
Senthil Kumaran 2010-12-08 08:04:49 +00:00
parent 24a0941a0f
commit f34445f7bd

View file

@ -1297,10 +1297,14 @@ class Transport:
def parse_response(self, response): def parse_response(self, response):
# read response data from httpresponse, and parse it # read response data from httpresponse, and parse it
# Check for new http response object, otherwise it is a file object.
if hasattr(response, 'getheader'):
if response.getheader("Content-Encoding", "") == "gzip": if response.getheader("Content-Encoding", "") == "gzip":
stream = GzipDecodedResponse(response) stream = GzipDecodedResponse(response)
else: else:
stream = response stream = response
else:
stream = response
p, u = self.getparser() p, u = self.getparser()