Skip to content

bpo-37658: Actually return result in race condition #29202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 29, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Actually fix issue37658
  • Loading branch information
Dreamsorcerer authored Oct 24, 2021
commit 019ed9d8810c374630e7adc9221c7f8e9377fdfc
4 changes: 2 additions & 2 deletions Lib/asyncio/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ async def wait_for(fut, timeout):

await _cancel_and_wait(fut, loop=loop)
try:
fut.result()
return fut.result()
except exceptions.CancelledError as exc:
raise exceptions.TimeoutError() from exc
else:
Expand Down Expand Up @@ -455,7 +455,7 @@ async def wait_for(fut, timeout):
# exception, we should re-raise it
# See https://bugs.python.org/issue40607
try:
fut.result()
return fut.result()
except exceptions.CancelledError as exc:
raise exceptions.TimeoutError() from exc
else:
Expand Down