Skip to content

Commit

Permalink
flake8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thefab committed Apr 18, 2018
1 parent 7925e1d commit f9dc883
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/test_pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_pubsub(self):
try:
yield c.pubsub_pop_message()
raise Exception("exception not raised")
except:
except Exception:
pass
res = yield c.pubsub_subscribe("foo1", "foo2")
self.assertTrue(res)
Expand All @@ -46,7 +46,7 @@ def test_pubsub(self):
try:
yield c.call("PING")
raise Exception("exception not raised")
except:
except Exception:
pass
res = yield c.pubsub_psubscribe("bar1*", "bar2*")
self.assertTrue(res)
Expand Down
9 changes: 4 additions & 5 deletions tornadis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,11 @@ def __init__(self, read_callback, close_callback,
self.unix_domain_socket = unix_domain_socket
self._state = ConnectionState()
self._ioloop = ioloop or tornado.ioloop.IOLoop.instance()

if int(tornado.version[0]) >= 5:
cb = tornado.ioloop.PeriodicCallback(self._on_every_second, 1000)
else:
cb = tornado.ioloop.PeriodicCallback(self._on_every_second, 1000, self._ioloop)

cb = tornado.ioloop.PeriodicCallback(self._on_every_second, 1000,
self._ioloop)
self.__periodic_callback = cb
self._read_callback = read_callback
self._close_callback = close_callback
Expand Down Expand Up @@ -219,12 +218,12 @@ def disconnect(self):
try:
self._ioloop.remove_handler(self.__socket_fileno)
self._listened_events = 0
except:
except Exception:
pass
self.__socket_fileno = -1
try:
self.__socket.close()
except:
except Exception:
pass
self._state.set_disconnected()
self._close_callback()
Expand Down
4 changes: 2 additions & 2 deletions tornadis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def format_args_in_redis_protocol(*args):
'*4\r\n$4\r\nHSET\r\n$3\r\nkey\r\n$5\r\nfield\r\n$5\r\nvalue\r\n'
"""
buf = WriteBuffer()
l = "*%d\r\n" % len(args)
l = "*%d\r\n" % len(args) # noqa: E741
if six.PY2:
buf.append(l)
else: # pragma: no cover
Expand All @@ -60,7 +60,7 @@ def format_args_in_redis_protocol(*args):
pass
else:
raise Exception("don't know what to do with %s" % type(arg))
l = "$%d\r\n" % len(arg)
l = "$%d\r\n" % len(arg) # noqa: E741
if six.PY2:
buf.append(l)
else: # pragma: no cover
Expand Down

0 comments on commit f9dc883

Please sign in to comment.