From cc574cec6d532f48f94275c0931311b3ca1f6c16 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 15 Jan 2017 03:57:58 -0600 Subject: [PATCH] WikiProjectTagger: Fix auto-assess when no current assessments. --- earwigbot/tasks/wikiproject_tagger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/earwigbot/tasks/wikiproject_tagger.py b/earwigbot/tasks/wikiproject_tagger.py index 9884d64..edff8aa 100644 --- a/earwigbot/tasks/wikiproject_tagger.py +++ b/earwigbot/tasks/wikiproject_tagger.py @@ -350,8 +350,8 @@ class WikiProjectTagger(Task): classes[value] += 1 values = tuple(classes.values()) - if values: - best = max(values) + best = max(values) + if best: confidence = float(best) / sum(values) if confidence > 0.75: rank = tuple(classes.keys())[values.index(best)]