Skip to content

Commit f3b7ff7

Browse files
committed
chore: bump pyflake, fix new warnings
1 parent eacbc2e commit f3b7ff7

File tree

11 files changed

+32
-31
lines changed

11 files changed

+32
-31
lines changed

.flake8

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
[flake8]
2-
ignore = BLK100
2+
builtins = _
3+
exclude =
4+
.git,
5+
__pycache__,
6+
.venv/,venv/,
7+
.tox/,
8+
build/,dist/,*egg,
9+
docs/conf.py,
10+
zookeeper/
11+
# See black's documentation for E203
12+
max-line-length = 79
13+
extend-ignore = BLK100,E203
14+

constraints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Consistent testing environment.
22
black==22.10.0
33
coverage==6.3.2
4-
flake8==3.9.2
4+
flake8==5.0.2
55
mock==3.0.5
66
objgraph==3.5.0
77
pytest==6.2.5

kazoo/protocol/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,13 +810,13 @@ def _authenticate_with_sasl(self, host, timeout):
810810
except puresasl.SASLError as err:
811811
six.reraise(
812812
SASLException,
813-
SASLException("library error: %s" % err.message),
813+
SASLException("library error: %s" % err),
814814
sys.exc_info()[2],
815815
)
816816
except puresasl.SASLProtocolException as err:
817817
six.reraise(
818818
AuthFailedError,
819-
AuthFailedError("protocol error: %s" % err.message),
819+
AuthFailedError("protocol error: %s" % err),
820820
sys.exc_info()[2],
821821
)
822822
except Exception as err:

kazoo/python2atexit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def _run_exitfuncs():
2525
func(*targs, **kargs)
2626
except SystemExit:
2727
exc_info = sys.exc_info()
28-
except:
28+
except: # noqa
2929
import traceback
3030

3131
sys.stderr.write("Error in atexit._run_exitfuncs:\n")

kazoo/testing/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ def run(self):
182182
# DEFAULT: console appender only
183183
log4j.rootLogger=INFO, ROLLINGFILE
184184
log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
185-
log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n
185+
log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} \
186+
[myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n
186187
log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
187188
log4j.appender.ROLLINGFILE.Threshold=DEBUG
188189
log4j.appender.ROLLINGFILE.File="""

kazoo/tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def u(s):
3737
else: # pragma: nocover
3838

3939
def u(s):
40-
return unicode(s, "unicode_escape")
40+
return unicode(s, "unicode_escape") # noqa
4141

4242

4343
class TestClientTransitions(KazooTestCase):

kazoo/tests/test_lock.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,21 @@ def test_lock(self):
134134
contender_bits = {}
135135

136136
for name in names:
137-
e = self.make_event()
138-
l = self.client.Lock(self.lockpath, name)
139-
t = self.make_thread(
140-
target=self._thread_lock_acquire_til_event, args=(name, l, e)
137+
ev = self.make_event()
138+
lock = self.client.Lock(self.lockpath, name)
139+
thread = self.make_thread(
140+
target=self._thread_lock_acquire_til_event,
141+
args=(name, lock, ev),
141142
)
142-
contender_bits[name] = (t, e)
143-
threads.append(t)
143+
contender_bits[name] = (thread, ev)
144+
threads.append(thread)
144145

145146
# acquire the lock ourselves first to make the others line up
146147
lock = self.client.Lock(self.lockpath, "test")
147148
lock.acquire()
148149

149-
for t in threads:
150-
t.start()
150+
for thread in threads:
151+
thread.start()
151152

152153
# wait for everyone to line up on the lock
153154
wait = self.make_wait()

kazoo/tests/test_paths.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def u(s):
1414
else: # pragma: nocover
1515

1616
def u(s):
17-
return unicode(s, "unicode_escape")
17+
return unicode(s, "unicode_escape") # noqa
1818

1919

2020
class NormPathTestCase(TestCase):

kazoo/tests/test_watchers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def changed(val, stat):
274274
b = False
275275
try:
276276
self.client.stop()
277-
except:
277+
except: # noqa
278278
b = True
279279
assert b is False
280280

kazoo/tests/util.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ def __call__(self, func=None, timeout=None, wait=None, message=None):
133133
return
134134
if now() > deadline:
135135
raise self.TimeOutWaitingFor(
136-
message
137-
or getattr(func, "__doc__")
138-
or getattr(func, "__name__")
136+
message or func.__doc__ or func.__name__
139137
)
140138

141139

0 commit comments

Comments
 (0)