From 3c3c361f50a7f8c78718ecccf5f79eba3b624629 Mon Sep 17 00:00:00 2001 From: LoopThrough-i-j Date: Tue, 27 Apr 2021 01:24:03 +0530 Subject: [PATCH] zulip: Fix call_on_each_event. Fix Improper assignement of narrow variable outside its scope. --- zulip/zulip/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index 18f523a..141187c 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -623,11 +623,12 @@ class Client: narrow = [] def do_register() -> Tuple[str, int]: - if event_types is None: - narrow = None while True: - res = self.register(event_types, narrow, **kwargs) + if event_types is None: + res = self.register(None, None, **kwargs) + else: + res = self.register(event_types, narrow, **kwargs) if 'error' in res['result']: if self.verbose: print("Server returned error:\n%s" % (res['msg'],))