Closed
Description
Bug report
Bug description:
async def __aenter__(self) -> "Timeout":
self._state = _State.ENTERED
self._task = tasks.current_task()
self._cancelling = self._task.cancelling() # AttributeError
if self._task is None:
raise RuntimeError("Timeout should be used inside a task")
self.reschedule(self._when)
return self
Honestly I don't know how to get this to error but it's possible according to the types
CPython versions tested on:
3.13, CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-111085 Fix logic order causing nicer error to never be raised in asyncio.Timeout #110910
- gh-111085: Fix invalid state handling in TaskGroup and Timeout #111111
- [3.12] gh-111085: Fix invalid state handling in TaskGroup and Timeout (GH-111111) #111171
- [3.11] gh-111085: Fix invalid state handling in TaskGroup and Timeout (GH-111111) #111172
Metadata
Metadata
Assignees
Labels
Projects
Status
Done