summaryrefslogtreecommitdiff
path: root/Lib/xmlrpclib.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-12-07 07:10:04 +0000
committerSenthil Kumaran <orsenthil@gmail.com>2010-12-07 07:10:04 +0000
commitd8e4edd5d2ece5e7016a7c3c35831e860c5c2039 (patch)
treef5eca2979194f56c39c2810efc8621e023b9c948 /Lib/xmlrpclib.py
parent705e8d882ffda73413cd9b3f5203d2b4a4d9ebeb (diff)
downloadcpython-git-d8e4edd5d2ece5e7016a7c3c35831e860c5c2039.tar.gz
Fix Issue8194 - Fix incompatible API change in the parse_respones for xmlrpclib.
Diffstat (limited to 'Lib/xmlrpclib.py')
-rw-r--r--Lib/xmlrpclib.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/xmlrpclib.py b/Lib/xmlrpclib.py
index b6aed62e3b..3cba39f59d 100644
--- a/Lib/xmlrpclib.py
+++ b/Lib/xmlrpclib.py
@@ -1446,8 +1446,13 @@ 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, else it is a file object
+ if hasattr(response,'getheader'):
+ if response.getheader("Content-Encoding", "") == "gzip":
+ stream = GzipDecodedResponse(response)
+ else:
+ stream = response
else:
stream = response