From 30d0d525af981f142a384921ee7680dd5b90c189 Mon Sep 17 00:00:00 2001 From: Paul Nameless Date: Wed, 3 Jun 2020 09:44:06 +0800 Subject: [PATCH] Fix mypy errors --- tg/controllers.py | 4 ++-- tg/update_handlers.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tg/controllers.py b/tg/controllers.py index a705846..b1efaaa 100644 --- a/tg/controllers.py +++ b/tg/controllers.py @@ -1,10 +1,10 @@ import curses import logging import os -import queue import threading from datetime import datetime from functools import partial +from queue import Queue from tempfile import NamedTemporaryFile from typing import Any, Callable, Dict, Optional @@ -46,7 +46,7 @@ class Controller: def __init__(self, model: Model, view: View, tg: Tdlib) -> None: self.model = model self.view = view - self.queue = queue.Queue() + self.queue: Queue = Queue() self.is_running = True self.tg = tg self.chat_size = 0.5 diff --git a/tg/update_handlers.py b/tg/update_handlers.py index 7f11a2d..a600677 100644 --- a/tg/update_handlers.py +++ b/tg/update_handlers.py @@ -169,7 +169,7 @@ def update_chat_last_msg(controller: Controller, update: Dict[str, Any]): current_chat_id = controller.model.current_chat_id if controller.model.chats.update_chat( - chat_id, last_message=message, order=order + chat_id, last_message=last_message, order=order ): controller._refresh_current_chat(current_chat_id)