]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-134451: Converted `asyncio.tools.CycleFoundException` from dataclass to a regular...
authorEvgeny Demchenko <v1mpire@icloud.com>
Fri, 23 May 2025 05:15:21 +0000 (08:15 +0300)
committerGitHub <noreply@github.com>
Fri, 23 May 2025 05:15:21 +0000 (05:15 +0000)
Lib/asyncio/tools.py
Misc/NEWS.d/next/Library/2025-05-22-14-12-53.gh-issue-134451.M1rD-j.rst [new file with mode: 0644]

index bf1cb5e64cbfbe3a7d10bdb15aa39326a7d2e16c..b2da7d2f6ba10cded27354c5b6e7fbf83032e29c 100644 (file)
@@ -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 ───────────────────────────────────────────
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 (file)
index 0000000..3c8339f
--- /dev/null
@@ -0,0 +1 @@
+Converted ``asyncio.tools.CycleFoundException`` from dataclass to a regular exception type.