diff options
| author | Quentin Pradet <quentin@pradet.me> | 2018-11-19 20:39:41 +0400 |
|---|---|---|
| committer | Seth M. Larson <sethmichaellarson@gmail.com> | 2018-11-19 10:39:41 -0600 |
| commit | d0255e01b616f02b45eb207459937a9666e13af6 (patch) | |
| tree | c1bed98eece5d57cd51c61ce7a89e81a8e5413d2 /src | |
| parent | 0cedb3b0f1e5d79c89c6db767c534b064b794cf2 (diff) | |
| download | urllib3-d0255e01b616f02b45eb207459937a9666e13af6.tar.gz | |
Restore Flake8 CI checks (#1477)
Diffstat (limited to 'src')
| -rw-r--r-- | src/urllib3/connection.py | 2 | ||||
| -rw-r--r-- | src/urllib3/connectionpool.py | 2 | ||||
| -rw-r--r-- | src/urllib3/contrib/pyopenssl.py | 4 | ||||
| -rw-r--r-- | src/urllib3/contrib/socks.py | 2 | ||||
| -rw-r--r-- | src/urllib3/poolmanager.py | 2 | ||||
| -rw-r--r-- | src/urllib3/response.py | 4 | ||||
| -rw-r--r-- | src/urllib3/util/ssl_.py | 2 |
7 files changed, 9 insertions, 9 deletions
diff --git a/src/urllib3/connection.py b/src/urllib3/connection.py index 02b36654..ba269b7a 100644 --- a/src/urllib3/connection.py +++ b/src/urllib3/connection.py @@ -158,7 +158,7 @@ class HTTPConnection(_HTTPConnection, object): conn = connection.create_connection( (self._dns_host, self.port), self.timeout, **extra_kw) - except SocketTimeout as e: + except SocketTimeout: raise ConnectTimeoutError( self, "Connection to %s timed out. (connect timeout=%s)" % (self.host, self.timeout)) diff --git a/src/urllib3/connectionpool.py b/src/urllib3/connectionpool.py index f7a8f193..d65581ee 100644 --- a/src/urllib3/connectionpool.py +++ b/src/urllib3/connectionpool.py @@ -672,7 +672,7 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods): # released back to the pool once the entire response is read response.read() except (TimeoutError, HTTPException, SocketError, ProtocolError, - BaseSSLError, SSLError) as e: + BaseSSLError, SSLError): pass # Handle redirect? diff --git a/src/urllib3/contrib/pyopenssl.py b/src/urllib3/contrib/pyopenssl.py index 7c0e9465..539bf8a8 100644 --- a/src/urllib3/contrib/pyopenssl.py +++ b/src/urllib3/contrib/pyopenssl.py @@ -276,7 +276,7 @@ class WrappedSocket(object): return b'' else: raise SocketError(str(e)) - except OpenSSL.SSL.ZeroReturnError as e: + except OpenSSL.SSL.ZeroReturnError: if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN: return b'' else: @@ -297,7 +297,7 @@ class WrappedSocket(object): return 0 else: raise SocketError(str(e)) - except OpenSSL.SSL.ZeroReturnError as e: + except OpenSSL.SSL.ZeroReturnError: if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN: return 0 else: diff --git a/src/urllib3/contrib/socks.py b/src/urllib3/contrib/socks.py index 811e312e..532d99ce 100644 --- a/src/urllib3/contrib/socks.py +++ b/src/urllib3/contrib/socks.py @@ -88,7 +88,7 @@ class SOCKSConnection(HTTPConnection): **extra_kw ) - except SocketTimeout as e: + except SocketTimeout: raise ConnectTimeoutError( self, "Connection to %s timed out. (connect timeout=%s)" % (self.host, self.timeout)) diff --git a/src/urllib3/poolmanager.py b/src/urllib3/poolmanager.py index fe5491cf..70393249 100644 --- a/src/urllib3/poolmanager.py +++ b/src/urllib3/poolmanager.py @@ -47,7 +47,7 @@ _key_fields = ( 'key__socks_options', # dict 'key_assert_hostname', # bool or string 'key_assert_fingerprint', # str - 'key_server_hostname', #str + 'key_server_hostname', # str ) #: The namedtuple class used to construct keys for the connection pool. diff --git a/src/urllib3/response.py b/src/urllib3/response.py index c112690b..97cdfd13 100644 --- a/src/urllib3/response.py +++ b/src/urllib3/response.py @@ -311,7 +311,9 @@ class HTTPResponse(io.IOBase): if content_encoding in self.CONTENT_DECODERS: self._decoder = _get_decoder(content_encoding) elif ',' in content_encoding: - encodings = [e.strip() for e in content_encoding.split(',') if e.strip() in self.CONTENT_DECODERS] + encodings = [ + e.strip() for e in content_encoding.split(',') + if e.strip() in self.CONTENT_DECODERS] if len(encodings): self._decoder = _get_decoder(content_encoding) diff --git a/src/urllib3/util/ssl_.py b/src/urllib3/util/ssl_.py index 64ea192a..00a6fdf8 100644 --- a/src/urllib3/util/ssl_.py +++ b/src/urllib3/util/ssl_.py @@ -112,8 +112,6 @@ DEFAULT_CIPHERS = ':'.join([ try: from ssl import SSLContext # Modern SSL? except ImportError: - import sys - class SSLContext(object): # Platform-specific: Python 2 def __init__(self, protocol_version): self.protocol = protocol_version |
