From 764fbdd6adfe9379e8b7c6674943927ca20a228a Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Thu, 21 Nov 2024 15:26:11 -0500 Subject: [PATCH] fixup for 3.9 --- chia/util/task_referencer.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/chia/util/task_referencer.py b/chia/util/task_referencer.py index be7bb82376bf..fb4801b82635 100644 --- a/chia/util/task_referencer.py +++ b/chia/util/task_referencer.py @@ -15,10 +15,9 @@ logger = logging.getLogger(__name__) -@dataclasses.dataclass(frozen=True, slots=True) +@dataclasses.dataclass(frozen=True) class _TaskInfo: - task: asyncio.Task[object] = dataclasses.field(hash=False) - task_object_id: int + task: asyncio.Task[object] name: str known_unreferenced: bool @@ -26,7 +25,7 @@ def __str__(self) -> str: return self.name -@dataclasses.dataclass(slots=True) +@dataclasses.dataclass class _TaskReferencer: """Holds strong references to tasks until they are done. This compensates for asyncio holding only weak references. This should be replaced by patterns using @@ -53,7 +52,6 @@ def create_task( self.tasks.append( _TaskInfo( task=task, - task_object_id=id(task), name=task.get_name(), known_unreferenced=known_unreferenced, )