From 6486b0fc99d82958419552d491da62d4dbcdbd8a Mon Sep 17 00:00:00 2001 From: coolguy-cell Date: Tue, 9 Jun 2020 15:21:19 +0530 Subject: [PATCH] fixed CQ for bitmessageqt.safehtmlparser module --- src/bitmessageqt/safehtmlparser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/safehtmlparser.py b/src/bitmessageqt/safehtmlparser.py index edacd4bb..d408d2c7 100644 --- a/src/bitmessageqt/safehtmlparser.py +++ b/src/bitmessageqt/safehtmlparser.py @@ -65,6 +65,8 @@ class SafeHTMLParser(HTMLParser): HTMLParser.__init__(self, *args, **kwargs) self.reset() self.reset_safe() + self.has_html = None + self.allow_picture = None def reset_safe(self): """Reset runtime variables specific to this class""" @@ -92,7 +94,7 @@ class SafeHTMLParser(HTMLParser): if url.scheme not in self.src_schemes: val = "" self.sanitised += " " + quote_plus(attr) - if not (val is None): + if val is not None: self.sanitised += "=\"" + val + "\"" if inspect.stack()[1][3] == "handle_startendtag": self.sanitised += "/"