Skip to content

gh-157058: Fix missing awaited-by edge in wait_for(fut, 0) - #157059

Open
deadlovelll wants to merge 2 commits into
python:mainfrom
deadlovelll:gh-157058-waitfor
Open

gh-157058: Fix missing awaited-by edge in wait_for(fut, 0)#157059
deadlovelll wants to merge 2 commits into
python:mainfrom
deadlovelll:gh-157058-waitfor

Conversation

@deadlovelll

Copy link
Copy Markdown
Contributor

Fix missing awaited-by edge in wait_for(fut, 0)

For more details see gh-157058

Comment thread Lib/asyncio/tasks.py Outdated

# gh-157058: awaiting the waiter leaves no edge on fut, add it here
cur_task = current_task()
if cur_task is not None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can current task be None here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it can be, but looking a bit deeper future_add_to_awaited_by() already checks that input is already Future. So there's no need in this check, thanks! I pushed the change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants