From 4377828a6c90af1c8ef8f68e4ef3d0f132f6101c Mon Sep 17 00:00:00 2001 From: RenameMe1 Date: Thu, 22 May 2025 10:54:32 +0300 Subject: [PATCH 1/3] Removed @dataclass for the CycleFoundException class --- Lib/asyncio/tools.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Lib/asyncio/tools.py b/Lib/asyncio/tools.py index bf1cb5e64cbfbe..cae90f59636b61 100644 --- a/Lib/asyncio/tools.py +++ b/Lib/asyncio/tools.py @@ -13,11 +13,17 @@ class NodeType(Enum): TASK = 2 -@dataclass(frozen=True) class CycleFoundException(Exception): """Raised when there is a cycle when drawing the call tree.""" - cycles: list[list[int]] - id2name: dict[int, str] + def __init__( + self, + cycles: list[list[int]], + id2name: dict[int, str], + ) -> None: + super().__init__(cycles, id2name) + self.cycles = cycles + self.id2name = id2name + # ─── indexing helpers ─────────────────────────────────────────── From 62edb5596e6df5ad1cf8d95734a9be137c147687 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 14:12:54 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2025-05-22-14-12-53.gh-issue-134451.M1rD-j.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2025-05-22-14-12-53.gh-issue-134451.M1rD-j.rst diff --git a/Misc/NEWS.d/next/Library/2025-05-22-14-12-53.gh-issue-134451.M1rD-j.rst b/Misc/NEWS.d/next/Library/2025-05-22-14-12-53.gh-issue-134451.M1rD-j.rst new file mode 100644 index 00000000000000..23ed857615d0c4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-05-22-14-12-53.gh-issue-134451.M1rD-j.rst @@ -0,0 +1 @@ +Deleted @dataclass for asyncio.tools. CycleFoundException class From f31da6f608bb68ab1dd68e9cbe41e0646dda7f6a Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Fri, 23 May 2025 10:18:42 +0530 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: sobolevn --- Lib/asyncio/tools.py | 2 +- .../next/Library/2025-05-22-14-12-53.gh-issue-134451.M1rD-j.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/asyncio/tools.py b/Lib/asyncio/tools.py index cae90f59636b61..b2da7d2f6ba10c 100644 --- a/Lib/asyncio/tools.py +++ b/Lib/asyncio/tools.py @@ -19,7 +19,7 @@ def __init__( self, cycles: list[list[int]], id2name: dict[int, str], - ) -> None: + ) -> None: super().__init__(cycles, id2name) self.cycles = cycles self.id2name = id2name diff --git a/Misc/NEWS.d/next/Library/2025-05-22-14-12-53.gh-issue-134451.M1rD-j.rst b/Misc/NEWS.d/next/Library/2025-05-22-14-12-53.gh-issue-134451.M1rD-j.rst index 23ed857615d0c4..3c8339f8842254 100644 --- a/Misc/NEWS.d/next/Library/2025-05-22-14-12-53.gh-issue-134451.M1rD-j.rst +++ b/Misc/NEWS.d/next/Library/2025-05-22-14-12-53.gh-issue-134451.M1rD-j.rst @@ -1 +1 @@ -Deleted @dataclass for asyncio.tools. CycleFoundException class +Converted ``asyncio.tools.CycleFoundException`` from dataclass to a regular exception type.