From 669c18fdc01fbcbc19315f87275301045631064d Mon Sep 17 00:00:00 2001 From: reddere <111050360+reddere@users.noreply.github.com> Date: Sat, 3 Dec 2022 14:11:07 +0100 Subject: [PATCH] update updated "== None" to "is None" and adjusted the else statement --- telebot/util.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/telebot/util.py b/telebot/util.py index 5eee539..86528a8 100644 --- a/telebot/util.py +++ b/telebot/util.py @@ -399,11 +399,10 @@ def escape(text: str) -> str: :return: the escaped text """ chars = {"&": "&", "<": "<", ">": ">"} - if text == None: + if text is None: return None else: - for old, new in chars.items(): - text = text.replace(old, new) + for old, new in chars.items(): text = text.replace(old, new) return text