Skip to content

Commit

Permalink
fixup for 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed Nov 21, 2024
1 parent f890efb commit 764fbdd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions chia/util/task_referencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@
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

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
Expand All @@ -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,
)
Expand Down

0 comments on commit 764fbdd

Please sign in to comment.