Kaydet (Commit) af84a2de authored tarafından Karl-Aksel Puulmann's avatar Karl-Aksel Puulmann

Python 3 fixes

üst 375521d7
...@@ -228,7 +228,10 @@ class Client(requests.Session): ...@@ -228,7 +228,10 @@ class Client(requests.Session):
def _get_raw_response_socket(self, response): def _get_raw_response_socket(self, response):
self._raise_for_status(response) self._raise_for_status(response)
return response.raw._fp.fp._sock if six.PY3:
return response.raw._fp.fp.raw._sock
else:
return response.raw._fp.fp._sock
def _stream_helper(self, response): def _stream_helper(self, response):
"""Generator for data coming from a chunked-encoded HTTP response.""" """Generator for data coming from a chunked-encoded HTTP response."""
...@@ -264,7 +267,10 @@ class Client(requests.Session): ...@@ -264,7 +267,10 @@ class Client(requests.Session):
socket = self._get_raw_response_socket(response) socket = self._get_raw_response_socket(response)
def recvall(socket, size): def recvall(socket, size):
data = '' if six.PY3:
data = bytes()
else:
data = ''
while size > 0: while size > 0:
block = socket.recv(size) block = socket.recv(size)
if not block: if not block:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment