From daf6a726b929e876e01ea939206ed1065c9ef445 Mon Sep 17 00:00:00 2001 From: Fallen_Breath Date: Tue, 17 Sep 2024 17:34:42 +0800 Subject: [PATCH] fixed incompatibility with python3.8 resolved #44 --- prime_backup/mcdr/task_manager.py | 2 +- prime_backup/mcdr/task_queue.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/prime_backup/mcdr/task_manager.py b/prime_backup/mcdr/task_manager.py index 8a4ac48..8722c4c 100644 --- a/prime_backup/mcdr/task_manager.py +++ b/prime_backup/mcdr/task_manager.py @@ -167,7 +167,7 @@ def shutdown(self): # ================================== Interfaces ================================== - def add_task(self, task: Task[_T], callback: Optional[TaskCallback[_T]] = None, *, handle_tmo_err: bool = True) -> futures.Future[_T]: + def add_task(self, task: Task[_T], callback: Optional[TaskCallback[_T]] = None, *, handle_tmo_err: bool = True) -> 'futures.Future[_T]': source = task.source holder = TaskHolder(task, source, callback) if isinstance(task, HeavyTask): diff --git a/prime_backup/mcdr/task_queue.py b/prime_backup/mcdr/task_queue.py index f8ca8ce..7146ee5 100644 --- a/prime_backup/mcdr/task_queue.py +++ b/prime_backup/mcdr/task_queue.py @@ -21,7 +21,7 @@ class TaskHolder(Generic[_T]): task: 'Task[_T]' source: 'CommandSource' callback: Optional[TaskCallback[_T]] - future: futures.Future[_T] = dataclasses.field(default_factory=futures.Future) + future: 'futures.Future[_T]' = dataclasses.field(default_factory=futures.Future) def task_name(self) -> RTextBase: return self.task.get_name_text()