From 0d5434b9fc6632cf295ed800933bdc304e3c67aa Mon Sep 17 00:00:00 2001 From: Henri Hulski Date: Tue, 12 Apr 2022 13:18:25 +0200 Subject: [PATCH] refactor: remove obsolete HTMLParseError --- mezzanine/utils/html.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/mezzanine/utils/html.py b/mezzanine/utils/html.py index 4d48f9d12e..3dd7d79814 100644 --- a/mezzanine/utils/html.py +++ b/mezzanine/utils/html.py @@ -1,13 +1,6 @@ from html.entities import name2codepoint from html.parser import HTMLParser -try: - from html.parser import HTMLParseError -except ImportError: # Python 3.5+ - - class HTMLParseError(Exception): - pass - import re from mezzanine.utils.deprecation import mark_safe @@ -161,12 +154,8 @@ def __init__(self, html): HTMLParser.__init__(self) self.html = html self.tags = [] - try: - self.feed(self.html) - except HTMLParseError: - pass - else: - self.html += "".join("" % tag for tag in self.tags) + self.feed(self.html) + self.html += "".join("" % tag for tag in self.tags) def handle_starttag(self, tag, attrs): if tag not in SELF_CLOSING_TAGS: