use isinstance, not type

This commit is contained in:
callebtc 2022-11-25 15:20:39 +01:00
parent b970f0cb0c
commit aa0fbde541

View File

@ -79,7 +79,7 @@ class Connection(Compat):
CLEANR = re.compile("<.*?>|&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-f]{1,6});")
def cleanhtml(raw_html):
if type(raw_html) == str:
if isinstance(raw_html, str):
cleantext = re.sub(CLEANR, "", raw_html)
return cleantext
else: