Move all logic related to score reasons until after we've checked if we have

reasons (mixed_unicode.py)
This commit is contained in:
jesopo 2018-11-20 20:43:26 +00:00
parent 993403f213
commit b8518d745f

View file

@ -77,11 +77,11 @@ class Module(ModuleManager.BaseModule):
reasons.extend([ScoreReason.AdditionalScript]*(len(scripts)-1))
score = len(reasons)
if score > 0:
reasons_s = []
for reason, count in collections.Counter(reasons).items():
reasons_s.append("%s: %s" % (reason, count))
if score > 0:
self.log.trace(
"Message given a mixed-unicode score of %s (reasons: %s)",
[score, ", ".join(reasons_s)])