Kaydet (Commit) 7a462970 authored tarafından Joffrey F's avatar Joffrey F

Merge pull request #316 from Precis/socket_wrapper

Wrap response socket for platform compatibility.
...@@ -17,6 +17,7 @@ import os ...@@ -17,6 +17,7 @@ import os
import re import re
import shlex import shlex
import struct import struct
from socket import socket as socket_obj
import warnings import warnings
import requests import requests
...@@ -264,7 +265,7 @@ class Client(requests.Session): ...@@ -264,7 +265,7 @@ class Client(requests.Session):
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."""
socket_fp = self._get_raw_response_socket(response) socket_fp = socket_obj(_sock=self._get_raw_response_socket(response))
socket_fp.setblocking(1) socket_fp.setblocking(1)
socket = socket_fp.makefile() socket = socket_fp.makefile()
while True: while True:
......
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