mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix Issue8194 - Fix incompatible API change in the parse_respones for xmlrpclib.
This commit is contained in:
parent
24a0941a0f
commit
f34445f7bd
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue