Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flake8 warnings/errors #248

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ commands =
passenv = ZPC_TEST_TIME_FACTOR

[flake8]
ignore = E501,E128
ignore = E501,E128,W503
filename = *.py,zerorpc
exclude = tests,.git,dist,doc,*.egg-info,__pycache__,setup.py
2 changes: 1 addition & 1 deletion zerorpc/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def emit_event(self, event, timeout=None):
self._remote_queue_open_slots -= 1
try:
self._channel.emit_event(event)
except:
except Exception:
self._remote_queue_open_slots += 1
raise

Expand Down
8 changes: 4 additions & 4 deletions zerorpc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def _filter_methods(cls, self, methods):
server_methods = set(k for k in dir(cls) if not k.startswith('_'))
return dict((k, getattr(methods, k))
for k in dir(methods)
if callable(getattr(methods, k)) and
not k.startswith('_') and k not in server_methods
if callable(getattr(methods, k))
and not k.startswith('_') and k not in server_methods
)

@staticmethod
Expand Down Expand Up @@ -268,8 +268,8 @@ def __call__(self, method, *args, **kargs):

# In python 3.7, "async" is a reserved keyword, clients should now use
# "async_": support both for the time being
if (kargs.get('async', False) is False and
kargs.get('async_', False) is False):
if (kargs.get('async', False) is False
and kargs.get('async_', False) is False):
return self._process_response(request_event, bufchan, timeout)

async_result = gevent.event.AsyncResult()
Expand Down
6 changes: 3 additions & 3 deletions zerorpc/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ def _send(self, parts):
for i in range(len(parts) - 1):
try:
self._socket.send(parts[i], copy=False, flags=zmq.SNDMORE)
except (gevent.GreenletExit, gevent.Timeout) as e:
except (gevent.GreenletExit, gevent.Timeout):
if i == 0:
raise
self._socket.send(parts[i], copy=False, flags=zmq.SNDMORE)
try:
self._socket.send(parts[-1], copy=False)
except (gevent.GreenletExit, gevent.Timeout) as e:
except (gevent.GreenletExit, gevent.Timeout):
self._socket.send(parts[-1], copy=False)
if e:
raise e
Expand All @@ -97,7 +97,7 @@ def _recv(self):
while True:
try:
part = self._socket.recv(copy=False)
except (gevent.GreenletExit, gevent.Timeout) as e:
except (gevent.GreenletExit, gevent.Timeout):
if len(parts) == 0:
raise
part = self._socket.recv(copy=False)
Expand Down