-
- Notifications
You must be signed in to change notification settings - Fork 33.6k
Closed
Labels
Description
Bug report
After 592ada9 it appears this function not longer cares about self._scheduled or TimerHandle but the docstring seems to imply otherwise
Your environment
- CPython versions tested on: 3.12.0a4
- Operating system and architecture: MacOS
I only noticed because it was unexpectedly more expensive
I think its dead code and can be simplified to:
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index cbabb43ae0..070ea1044d 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -1857,11 +1857,9 @@ def call_exception_handler(self, context): exc_info=True) def _add_callback(self, handle): - """Add a Handle to _scheduled (TimerHandle) or _ready.""" + """Add a Handle to _ready.""" assert isinstance(handle, events.Handle), 'A Handle is required here' - if handle._cancelled: - return - assert not isinstance(handle, events.TimerHandle) + if not handle._cancelled: self._ready.append(handle) def _add_callback_signalsafe(self, handle):Linked PRs
- gh-101143: Remove references to TimerHandle from asyncio.base_events.BaseEventLoop._add_callback #101197
- [3.10] gh-101143: Remove references to
TimerHandlefromasyncio.base_events.BaseEventLoop._add_callback(GH-101197) #101216 - [3.11] gh-101143: Remove references to
TimerHandlefromasyncio.base_events.BaseEventLoop._add_callback(GH-101197) #101217
Metadata
Metadata
Assignees
Labels
Projects
Status
Done
