Skip to content

Commit

Permalink
Fediverse and Poll: Run Black
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Nov 9, 2021
1 parent feaa02a commit 8326d6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/Fediverse/test.py
Expand Up @@ -100,7 +100,7 @@ def testHasWebfingerSupport(self):


class NetworklessFediverseTestCase(BaseFediverseTestCase):
timeout = 1.
timeout = 1.0

@contextlib.contextmanager
def mockWebfingerSupport(self, value):
Expand Down
7 changes: 5 additions & 2 deletions plugins/Poll/plugin.py
Expand Up @@ -133,14 +133,17 @@ def add(self, irc, msg, args, channel, question, answers):

answers = [(answer.split()[0], answer) for answer in answers]

answer_id_counts = collections.Counter(id_ for (id_, _) in answers).items()
answer_id_counts = collections.Counter(
id_ for (id_, _) in answers
).items()
duplicate_answer_ids = [
answer_id for (answer_id, count) in answer_id_counts if count > 1
]
if duplicate_answer_ids:
irc.error(
format(
_("Duplicate answer identifier(s): %L"), duplicate_answer_ids
_("Duplicate answer identifier(s): %L"),
duplicate_answer_ids,
),
Raise=True,
)
Expand Down

0 comments on commit 8326d6e

Please sign in to comment.