Skip to content

gh-101143: Remove references to TimerHandle from asyncio.base_events.BaseEventLoop._add_callback #101197

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 5 commits into from
Jan 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 3 additions & 6 deletions Lib/asyncio/base_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1857,12 +1857,9 @@ def call_exception_handler(self, context):
exc_info=True)

def _add_callback(self, handle):
"""Add a Handle to _scheduled (TimerHandle) or _ready."""
assert isinstance(handle, events.Handle), 'A Handle is required here'
if handle._cancelled:
return
assert not isinstance(handle, events.TimerHandle)
self._ready.append(handle)
"""Add a Handle to _ready."""
if not handle._cancelled:
self._ready.append(handle)

def _add_callback_signalsafe(self, handle):
"""Like _add_callback() but called from a signal handler."""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove unused references to :class:`~asyncio.TimerHandle` in
``asyncio.base_events.BaseEventLoop._add_callback``.