summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/base_events.py
diff options
context:
space:
mode:
authorJ. Nick Koston <nick@koston.org>2023-01-21 09:16:07 (GMT)
committerGitHub <noreply@github.com>2023-01-21 09:16:07 (GMT)
commit9e947675ae3dc32f5863e5ed3022301cf7fd79b4 (patch)
treee45fdc2e94fcd859df6963b8fe3b67542c1d8195 /Lib/asyncio/base_events.py
parentc22a55c8b4f142ff679880ec954691d5920b7845 (diff)
downloadcpython-9e947675ae3dc32f5863e5ed3022301cf7fd79b4.zip
cpython-9e947675ae3dc32f5863e5ed3022301cf7fd79b4.tar.gz
cpython-9e947675ae3dc32f5863e5ed3022301cf7fd79b4.tar.bz2
gh-101143: Remove references to `TimerHandle` from `asyncio.base_events.BaseEventLoop._add_callback` (#101197)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Diffstat (limited to 'Lib/asyncio/base_events.py')
-rw-r--r--Lib/asyncio/base_events.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index cbabb43..32d7e1c 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -1857,12 +1857,9 @@ class BaseEventLoop(events.AbstractEventLoop):
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."""