Clean up flake8 errors from merge

This commit is contained in:
Cory Benfield
2017-05-31 10:39:27 +01:00
parent f308ea1a31
commit a6f7f5dc62
3 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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)
+2
View File
@@ -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