Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
2018-03-16 09:58:09 -04:00
parent 8f3f022c54
commit b72081f3c0
3 changed files with 17 additions and 17 deletions
+15 -15
View File
@@ -10,20 +10,20 @@ and maintain connections.
import os.path
import socket
from urllib3.poolmanager import PoolManager, proxy_from_url
from urllib3.response import HTTPResponse
from urllib3.util import Timeout as TimeoutSauce
from urllib3.util.retry import Retry
from urllib3.exceptions import ClosedPoolError
from urllib3.exceptions import ConnectTimeoutError
from urllib3.exceptions import HTTPError as _HTTPError
from urllib3.exceptions import MaxRetryError
from urllib3.exceptions import NewConnectionError
from urllib3.exceptions import ProxyError as _ProxyError
from urllib3.exceptions import ProtocolError
from urllib3.exceptions import ReadTimeoutError
from urllib3.exceptions import SSLError as _SSLError
from urllib3.exceptions import ResponseError
from requests_core.http_manager.poolmanager import PoolManager, proxy_from_url
from requests_core.http_manager.response import HTTPResponse
from requests_core.http_manager.util import Timeout as TimeoutSauce
from requests_core.http_manager.util.retry import Retry
from requests_core.http_manager.exceptions import ClosedPoolError
from requests_core.http_manager.exceptions import ConnectTimeoutError
from requests_core.http_manager.exceptions import HTTPError as _HTTPError
from requests_core.http_manager.exceptions import MaxRetryError
from requests_core.http_manager.exceptions import NewConnectionError
from requests_core.http_manager.exceptions import ProxyError as _ProxyError
from requests_core.http_manager.exceptions import ProtocolError
from requests_core.http_manager.exceptions import ReadTimeoutError
from requests_core.http_manager.exceptions import SSLError as _SSLError
from requests_core.http_manager.exceptions import ResponseError
from .models import Response
from .basics import urlparse, basestring
@@ -49,7 +49,7 @@ from .exceptions import (
from .auth import _basic_auth_str
try:
from urllib3.contrib.socks import SOCKSProxyManager
from requests_core.http_manager.contrib.socks import SOCKSProxyManager
except ImportError:
def SOCKSProxyManager(*args, **kwargs):
+1 -1
View File
@@ -139,7 +139,7 @@ def extract_cookies_to_jar(jar, request, response):
# the _original_response field is the wrapped httplib.HTTPResponse object,
req = MockRequest(request)
# pull out the HTTPMessage with the headers and put it in the mock:
res = MockResponse(response._original_response.msg)
res = MockResponse(response._original_response.headers)
jar.extract_cookies(res, req)
+1 -1
View File
@@ -773,7 +773,7 @@ class Response(object):
if hasattr(self.raw, 'stream'):
try:
for chunk in self.raw.stream(
chunk_size, decode_content=True
chunk_size, # decode_content=True
):
yield chunk