From: Thorsten Date: Sat, 27 Jun 2020 17:14:54 +0000 (+0200) Subject: python 3.5 X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=8f1b94307c8034301d3a25caf65825889a6e5980;p=urlbot-v3.git python 3.5 --- diff --git a/distbot/bot/action_worker.py b/distbot/bot/action_worker.py index 0d96371..fcf1bc6 100644 --- a/distbot/bot/action_worker.py +++ b/distbot/bot/action_worker.py @@ -3,9 +3,7 @@ import json import logging import threading import time -from typing import Optional -from pika.adapters import AsyncioConnection from pika.channel import Channel from distbot.common.action import Action, send_action @@ -42,8 +40,8 @@ class ActionWorker(object): def __init__(self, bot, queue_name): self._bot = bot - self._connection: Optional[AsyncioConnection] = None - self._channel: Optional[Channel] = None + self._connection = None + self._channel = None self._queue_name = queue_name self._consumer_tag = None @@ -74,8 +72,7 @@ class ActionWorker(object): self._consumer_tag = self._channel.basic_consume( self.on_message, self._queue_name ) - logging.info( - f"Setup consumer for actions on ch {self._channel} on con {self._connection} with tag {self._consumer_tag}") + logging.info("Setup consumer for actions on ch %s on con %s with tag %s", self._channel, self._connection, self._consumer_tag) def on_message(self, ch, method, properties, body): logging.info('Received message # %s from %s: %s',