mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Clean up flake8 errors from merge
This commit is contained in:
+2
-2
@@ -21,7 +21,7 @@ from urllib3.fields import RequestField
|
||||
from urllib3.filepost import encode_multipart_formdata
|
||||
from urllib3.util import parse_url
|
||||
from urllib3.exceptions import (
|
||||
DecodeError, ReadTimeoutError, ProtocolError, LocationParseError, ConnectionError)
|
||||
DecodeError, ReadTimeoutError, ProtocolError, LocationParseError)
|
||||
|
||||
from io import UnsupportedOperation
|
||||
from .hooks import default_hooks
|
||||
@@ -502,7 +502,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
|
||||
|
||||
def prepare_content_length(self, body):
|
||||
"""Prepares Content-Length header.
|
||||
|
||||
|
||||
If the length of the body of the request can be computed, Content-Length
|
||||
is set using ``super_len``. If user has manually set either a
|
||||
Transfer-Encoding or Content-Length header when it should not be set
|
||||
|
||||
@@ -124,7 +124,7 @@ class SessionRedirectMixin(object):
|
||||
reached.
|
||||
"""
|
||||
|
||||
history = [response] # keep track of history; seed it with the original response
|
||||
history = [response] # keep track of history; seed it with the original response
|
||||
|
||||
location_url = self.get_redirect_target(response)
|
||||
|
||||
|
||||
@@ -788,6 +788,7 @@ def parse_header_links(value):
|
||||
|
||||
return links
|
||||
|
||||
|
||||
def is_valid_location(response):
|
||||
"""Verify that multiple Location headers weren't
|
||||
returned from the last response.
|
||||
@@ -800,6 +801,7 @@ def is_valid_location(response):
|
||||
# If response.raw isn't urllib3-like we can't reliably check this
|
||||
return True
|
||||
|
||||
|
||||
# Null bytes; no need to recreate these on each call to guess_json_utf
|
||||
_null = '\x00'.encode('ascii') # encoding to ASCII for Python 3
|
||||
_null2 = _null * 2
|
||||
|
||||
Reference in New Issue
Block a user