updated "== None" to "is None" and adjusted the else statement
This commit is contained in:
reddere 2022-12-03 14:11:07 +01:00 committed by GitHub
parent 34acae9a59
commit 669c18fdc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -399,11 +399,10 @@ def escape(text: str) -> str:
:return: the escaped text
"""
chars = {"&": "&amp;", "<": "&lt;", ">": "&gt;"}
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