Skip to content

Commit f9dc883

Browse files
committed
flake8 fixes
1 parent 7925e1d commit f9dc883

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

tests/test_pubsub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_pubsub(self):
3737
try:
3838
yield c.pubsub_pop_message()
3939
raise Exception("exception not raised")
40-
except:
40+
except Exception:
4141
pass
4242
res = yield c.pubsub_subscribe("foo1", "foo2")
4343
self.assertTrue(res)
@@ -46,7 +46,7 @@ def test_pubsub(self):
4646
try:
4747
yield c.call("PING")
4848
raise Exception("exception not raised")
49-
except:
49+
except Exception:
5050
pass
5151
res = yield c.pubsub_psubscribe("bar1*", "bar2*")
5252
self.assertTrue(res)

tornadis/connection.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,11 @@ def __init__(self, read_callback, close_callback,
9292
self.unix_domain_socket = unix_domain_socket
9393
self._state = ConnectionState()
9494
self._ioloop = ioloop or tornado.ioloop.IOLoop.instance()
95-
9695
if int(tornado.version[0]) >= 5:
9796
cb = tornado.ioloop.PeriodicCallback(self._on_every_second, 1000)
9897
else:
99-
cb = tornado.ioloop.PeriodicCallback(self._on_every_second, 1000, self._ioloop)
100-
98+
cb = tornado.ioloop.PeriodicCallback(self._on_every_second, 1000,
99+
self._ioloop)
101100
self.__periodic_callback = cb
102101
self._read_callback = read_callback
103102
self._close_callback = close_callback
@@ -219,12 +218,12 @@ def disconnect(self):
219218
try:
220219
self._ioloop.remove_handler(self.__socket_fileno)
221220
self._listened_events = 0
222-
except:
221+
except Exception:
223222
pass
224223
self.__socket_fileno = -1
225224
try:
226225
self.__socket.close()
227-
except:
226+
except Exception:
228227
pass
229228
self._state.set_disconnected()
230229
self._close_callback()

tornadis/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def format_args_in_redis_protocol(*args):
3333
'*4\r\n$4\r\nHSET\r\n$3\r\nkey\r\n$5\r\nfield\r\n$5\r\nvalue\r\n'
3434
"""
3535
buf = WriteBuffer()
36-
l = "*%d\r\n" % len(args)
36+
l = "*%d\r\n" % len(args) # noqa: E741
3737
if six.PY2:
3838
buf.append(l)
3939
else: # pragma: no cover
@@ -60,7 +60,7 @@ def format_args_in_redis_protocol(*args):
6060
pass
6161
else:
6262
raise Exception("don't know what to do with %s" % type(arg))
63-
l = "$%d\r\n" % len(arg)
63+
l = "$%d\r\n" % len(arg) # noqa: E741
6464
if six.PY2:
6565
buf.append(l)
6666
else: # pragma: no cover

0 commit comments

Comments
 (0)