From 762861f3447698c6954016cf003758693dcc8bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= <6774676+eumiro@users.noreply.github.com> Date: Sun, 20 Nov 2022 20:14:25 +0100 Subject: refactor: use is for None --- mastodon/streaming.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'mastodon/streaming.py') diff --git a/mastodon/streaming.py b/mastodon/streaming.py index e43d7d6..08f5670 100644 --- a/mastodon/streaming.py +++ b/mastodon/streaming.py @@ -213,11 +213,11 @@ class CallbackStreamListener(StreamListener): self.status_update_handler = status_update_handler def on_update(self, status): - if self.update_handler != None: + if self.update_handler is not None: self.update_handler(status) try: - if self.local_update_handler != None and not "@" in status["account"]["acct"]: + if self.local_update_handler is not None and not "@" in status["account"]["acct"]: self.local_update_handler(status) except Exception as err: six.raise_from( @@ -226,21 +226,21 @@ class CallbackStreamListener(StreamListener): ) def on_delete(self, deleted_id): - if self.delete_handler != None: + if self.delete_handler is not None: self.delete_handler(deleted_id) def on_notification(self, notification): - if self.notification_handler != None: + if self.notification_handler is not None: self.notification_handler(notification) def on_conversation(self, conversation): - if self.conversation_handler != None: + if self.conversation_handler is not None: self.conversation_handler(conversation) def on_unknown_event(self, name, unknown_event=None): - if self.unknown_event_handler != None: + if self.unknown_event_handler is not None: self.unknown_event_handler(name, unknown_event) def on_status_update(self, status): - if self.status_update_handler != None: + if self.status_update_handler is not None: self.status_update_handler(status) -- cgit v1.2.3