Fix Issue8194 - Fix incompatible API change in the parse_respones for xmlrpclib.
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 @@
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