Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
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
Fix logic order causing nicer error to never be raised
  • Loading branch information
Gobot1234 authored Oct 15, 2023
commit 4071cd639e83c6fbfb53b8b57a5a14cba496d9cb
2 changes: 1 addition & 1 deletion Lib/asyncio/timeouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ def __repr__(self) -> str:
async def __aenter__(self) -> "Timeout":
self._state = _State.ENTERED
self._task = tasks.current_task()
self._cancelling = self._task.cancelling()
if self._task is None:
raise RuntimeError("Timeout should be used inside a task")
self._cancelling = self._task.cancelling()
self.reschedule(self._when)
return self

Expand Down