summaryrefslogtreecommitdiff
path: root/libmat2
diff options
context:
space:
mode:
Diffstat (limited to 'libmat2')
-rw-r--r--libmat2/web.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/libmat2/web.py b/libmat2/web.py
index 2864d60..8843c1e 100644
--- a/libmat2/web.py
+++ b/libmat2/web.py
@@ -104,6 +104,15 @@ class _HTMLParser(parser.HTMLParser):
104 self.tag_required_blocklist = required_blocklisted_tags 104 self.tag_required_blocklist = required_blocklisted_tags
105 self.tag_blocklist = blocklisted_tags 105 self.tag_blocklist = blocklisted_tags
106 106
107 def error(self, message): # pragma: no cover
108 """ Amusingly, Python's documentation doesn't mention that this
109 function needs to be implemented in subclasses of the parent class
110 of parser.HTMLParser. This was found by fuzzing,
111 triggering the following exception:
112 NotImplementedError: subclasses of ParserBase must override error()
113 """
114 raise ValueError(message)
115
107 def handle_starttag(self, tag: str, attrs: List[Tuple[str, Optional[str]]]): 116 def handle_starttag(self, tag: str, attrs: List[Tuple[str, Optional[str]]]):
108 # Ignore the type, because mypy is too stupid to infer 117 # Ignore the type, because mypy is too stupid to infer
109 # that get_starttag_text() can't return None. 118 # that get_starttag_text() can't return None.