aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/asyncio/tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio/tools.py')
-rw-r--r--Lib/asyncio/tools.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/asyncio/tools.py b/Lib/asyncio/tools.py
index b2da7d2f6ba..3fc4524c008 100644
--- a/Lib/asyncio/tools.py
+++ b/Lib/asyncio/tools.py
@@ -1,11 +1,10 @@
"""Tools to analyze tasks running in asyncio programs."""
-from dataclasses import dataclass
from collections import defaultdict
from itertools import count
from enum import Enum
import sys
-from _remote_debugging import get_all_awaited_by
+from _remote_debugging import RemoteUnwinder
class NodeType(Enum):
@@ -118,6 +117,11 @@ def _find_cycles(graph):
# ─── PRINT TREE FUNCTION ───────────────────────────────────────
+def get_all_awaited_by(pid):
+ unwinder = RemoteUnwinder(pid)
+ return unwinder.get_all_awaited_by()
+
+
def build_async_tree(result, task_emoji="(T)", cor_emoji=""):
"""
Build a list of strings for pretty-print an async call tree.