From 3fb9b991be55aef2c83544cf06c1906b3ad3aa39 Mon Sep 17 00:00:00 2001 From: Yongtao Huang Date: Tue, 20 Jan 2026 17:22:17 +0800 Subject: [PATCH] asyncio: fix ag_frame/cr_frame typo in call graph Fix a typo in asyncio call graph introspection. When handling objects with `ag_await`, the code incorrectly accesses `cr_frame`. Async generators expose their frame via `ag_frame`. This path seems effectively unreachable in normal asyncio execution; the change only corrects an attribute typo. Signed-off-by: Yongtao Huang --- Lib/asyncio/graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/asyncio/graph.py b/Lib/asyncio/graph.py index b5bfeb1630a159..76808f48867879 100644 --- a/Lib/asyncio/graph.py +++ b/Lib/asyncio/graph.py @@ -62,7 +62,7 @@ def _build_graph_for_future( coro = coro.cr_await elif hasattr(coro, 'ag_await'): # A native async generator or duck-type compatible iterator - st.append(FrameCallGraphEntry(coro.cr_frame)) + st.append(FrameCallGraphEntry(coro.ag_frame)) coro = coro.ag_await else: break