Skip to content

gh-148736: Use ag_frame when walking async generators in asyncio.graph#148737

Merged
kumaraditya303 merged 1 commit into
python:mainfrom
rajkripal:fix/asyncio-graph-ag-frame
Jul 26, 2026
Merged

gh-148736: Use ag_frame when walking async generators in asyncio.graph#148737
kumaraditya303 merged 1 commit into
python:mainfrom
rajkripal:fix/asyncio-graph-ag-frame

Conversation

@rajkripal

Copy link
Copy Markdown
Contributor

Fixes gh-148736.

One-line correction: the ag_await branch of _build_graph_for_future was using cr_frame instead of ag_frame. Added a regression test that constructs a minimal ag_await chain and exercises the walker directly.

@python-cla-bot

python-cla-bot Bot commented Apr 18, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

…o.graph

_build_graph_for_future appended FrameCallGraphEntry(coro.cr_frame) in
the ag_await branch; async generators expose ag_frame. The line is
unreachable via standard async-for (async_generator_asend has neither
cr_await nor ag_await) but is reachable from duck-typed chains.
@rajkripal
rajkripal force-pushed the fix/asyncio-graph-ag-frame branch from 6cb5387 to 9028577 Compare April 18, 2026 21:02
Comment thread Lib/test/test_asyncio/test_graph.py
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Jul 25, 2026
@kumaraditya303
kumaraditya303 merged commit 306a35c into python:main Jul 26, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asyncio.capture_call_graph: AttributeError walking async-generator ag_await chain

2 participants