Skip to content

Commit 51f1a69

Browse files
committed
Fix codestyle violations
1 parent 85fbbd6 commit 51f1a69

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

ipfshttpclient/requests_wrapper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _new_conn(self):
9999
try:
100100
conn = create_connection(
101101
(self._dns_host, self.port), self.timeout, **extra_kw)
102-
except socket.timeout as e:
102+
except socket.timeout:
103103
raise urllib3.exceptions.ConnectTimeoutError(
104104
self, "Connection to %s timed out. (connect timeout=%s)" %
105105
(self.host, self.timeout))
@@ -120,13 +120,14 @@ class HTTPSConnection(ConnectionOverrideMixin, urllib3.connection.HTTPSConnectio
120120
def __init__(self, *args, **kw):
121121
self.family = _kw_scheme_to_family(kw, "https")
122122
super(HTTPSConnection, self).__init__(*args, **kw)
123-
123+
124124

125125
# Override the higher-level `urllib3` ConnectionPool objects that instantiate
126126
# one or more Connection objects and dispatch work between them
127127
class HTTPConnectionPool(urllib3.HTTPConnectionPool):
128128
ConnectionCls = HTTPConnection
129129

130+
130131
class HTTPSConnectionPool(urllib3.HTTPConnectionPool):
131132
ConnectionCls = HTTPSConnection
132133

@@ -238,6 +239,7 @@ def request(method, url, **kwargs):
238239
with Session() as session:
239240
return session.request(method=method, url=url, **kwargs)
240241

242+
241243
def get(url, params=None, **kwargs):
242244
kwargs.setdefault('allow_redirects', True)
243245
return request('get', url, params=params, **kwargs)

tox.ini

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,26 @@ exclude = .git,.tox,+junk,coverage,dist,doc,*egg,build,tools,test/unit,docs,*__i
4141

4242
# E221: Multiple spaces before operator
4343
# E241: Multiple spaces after ',': Breaks element alignment collections
44+
# E251: Spaces around '=' on parameter assignment
4445
# E262: Inline comment should start with '# ': Breaks tagged comments (ie: '#TODO: ')
4546
# E265: Block comment should start with '# ': ^
4647
# E266: Too many leading '#' for block comment: Breaks declaring mega-blocks (ie: '### Section')
4748
# E303: More than 2 consecutive newlines
4849
# W292: No newline at end of file
4950
# W391: Blank line at end of file (sometimes trigged instead of the above!?)
5051
# F403: `from <module> import *` used; unable to detect undefined names ←– Probably should be fixed…
51-
ignore = E221,E241,E262,E265,E266,E303,W292,W391,F403
52+
ignore = E221,E241,E251,E262,E265,E266,E303,W292,W391,F403
5253
use-flake8-tabs = true
5354
max-line-length = 100
5455
tab-width = 4
5556

5657
# E701: Multiple statements on one line
57-
# - multipart.py: Lots of `yield from` polyfills using `for chunk in X: yield chunk`
58-
# - test_*.py: Aligning `assert … not in …` and `assert … in …` kind of statements
58+
# - multipart.py: Lots of `yield from` polyfills using `for chunk in X: yield chunk`
59+
# - requests_wrapper.py: Lots of symbols exported that we specifically don't use but that make sense in a reusable module
60+
# - test_*.py: Aligning `assert … not in …` and `assert … in …` kind of statements
5961
per-file-ignores =
6062
./ipfshttpclient/multipart.py:E701
63+
./ipfshttpclient/requests_wrapper.py:E401,E402,F401
6164
./test/functional/test_*.py:E272
6265

6366
[pytest]

0 commit comments

Comments
 (0)