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,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