]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-101143: Remove references to `TimerHandle` from `asyncio.base_events.BaseEventLoop...
authorJ. Nick Koston <nick@koston.org>
Sat, 21 Jan 2023 09:16:07 +0000 (23:16 -1000)
committerGitHub <noreply@github.com>
Sat, 21 Jan 2023 09:16:07 +0000 (14:46 +0530)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Lib/asyncio/base_events.py
Misc/NEWS.d/next/Library/2023-01-20-10-46-59.gh-issue-101143.hJo8hu.rst [new file with mode: 0644]

index cbabb43ae0600aff907c2d8565c9a0b53b1febca..32d7e1c481ecc55018e091de6126e9590dcaa72f 100644 (file)
@@ -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."""
diff --git a/Misc/NEWS.d/next/Library/2023-01-20-10-46-59.gh-issue-101143.hJo8hu.rst b/Misc/NEWS.d/next/Library/2023-01-20-10-46-59.gh-issue-101143.hJo8hu.rst
new file mode 100644 (file)
index 0000000..d14b9e2
--- /dev/null
@@ -0,0 +1,2 @@
+Remove unused references to :class:`~asyncio.TimerHandle` in
+``asyncio.base_events.BaseEventLoop._add_callback``.