From 0c75cd15dc1a8c27eae6d7903f94665cc338b785 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 22 Jul 2019 23:28:51 +0200 Subject: [PATCH] Remove a mypy workaround to bump coverage back to 100% --- libmat2/web.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libmat2/web.py b/libmat2/web.py index 91d5de1..b770200 100644 --- a/libmat2/web.py +++ b/libmat2/web.py @@ -97,10 +97,10 @@ class _HTMLParser(parser.HTMLParser): self.tag_blocklist = blocklisted_tags def handle_starttag(self, tag: str, attrs: List[Tuple[str, Optional[str]]]): - original_tag = self.get_starttag_text() - if not original_tag: # empty tag - return - self.__validation_queue.append(original_tag) + # Ignore the type, because mypy is too stupid to infer + # that get_starttag_text() can't return None. + original_tag = self.get_starttag_text() # type: ignore + self.__validation_queue.append(original_tag) # type: ignore if tag in self.tag_blocklist: self.__in_dangerous_tag += 1