From 8862bec3d98e95f9e2f94006a28ab77d43d26029 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Tue, 4 Sep 2012 01:50:54 -0400 Subject: [PATCH] Fix statements assigned to nothing. --- earwigbot/wiki/copyvios/parsers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/earwigbot/wiki/copyvios/parsers.py b/earwigbot/wiki/copyvios/parsers.py index c5e4325..ec7fe68 100644 --- a/earwigbot/wiki/copyvios/parsers.py +++ b/earwigbot/wiki/copyvios/parsers.py @@ -137,8 +137,10 @@ class HTMLTextParser(BaseTextParser): soup = bs4.BeautifulSoup(self.text).body is_comment = lambda text: isinstance(text, bs4.element.Comment) - [comment.extract() for comment in soup.find_all(text=is_comment)] + for comment in soup.find_all(text=is_comment): + comment.extract() for tag in self.hidden_tags: - [element.extract() for element in soup.find_all(tag)] + for element in soup.find_all(tag): + element.extract() return "\n".join(soup.stripped_strings)