From aa718da3e139e2be0c365c32b9704fcdc11a8204 Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Mon, 8 Jan 2018 06:49:02 -0800 Subject: [PATCH] Zephyr: For correctness & mypy, res.get('result') -> res['result']. Also correct nearby error message (subscribing to -> receiving). --- zulip/integrations/zephyr/check-mirroring | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zulip/integrations/zephyr/check-mirroring b/zulip/integrations/zephyr/check-mirroring index e465fec..2807f28 100755 --- a/zulip/integrations/zephyr/check-mirroring +++ b/zulip/integrations/zephyr/check-mirroring @@ -125,7 +125,7 @@ def send_zephyr(zwrite_args, content): # Subscribe to Zulip try: res = zulip_client.register(event_types=["message"]) - if 'error' in res.get('result'): + if 'error' in res['result']: logging.error("Error subscribing to Zulips!") logging.error(res['msg']) print_status_and_exit(1) @@ -263,8 +263,8 @@ logger.info("Starting receiving messages!") # receive zulips res = zulip_client.get_events(queue_id=queue_id, last_event_id=last_event_id) -if 'error' in res.get('result'): - logging.error("Error subscribing to Zulips!") +if 'error' in res['result']: + logging.error("Error receiving Zulips!") logging.error(res['msg']) print_status_and_exit(1) messages = [event['message'] for event in res['events']]