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