diff --git a/newspaper/outputformatters.py b/newspaper/outputformatters.py index a5e6e3c..db0b5a2 100644 --- a/newspaper/outputformatters.py +++ b/newspaper/outputformatters.py @@ -106,7 +106,7 @@ class OutputFormatter(object): self.top_node, "*[gravityScore]") for item in gravity_items: score = self.parser.getAttribute(item, 'gravityScore') - score = score and float(score) or 0 + score = float(score) if score else 0 if score < 1: item.getparent().remove(item)