Combine two ifs into a single line
This commit is contained in:
parent
009779dda0
commit
50cee5ede8
1 changed files with 2 additions and 3 deletions
|
|
@ -114,9 +114,8 @@ class TwythonStreamer(object):
|
|||
for message_type in self.handlers:
|
||||
if message_type in data:
|
||||
handler = getattr(self, 'on_' + message_type, None)
|
||||
if handler and callable(handler):
|
||||
if not handler(data.get(message_type)):
|
||||
break
|
||||
if handler and callable(handler) and not handler(data.get(message_type)):
|
||||
break
|
||||
except ValueError:
|
||||
self.on_error(response.status_code, 'Unable to decode response, not valid JSON.')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue