Skip to content

Commit 089eb7a

Browse files
committed
uasyncio: fix loop.cancel()
Schedule task for execution when pend_throw() returns None (and not False). None is the default value returned by pend_throw() when called the first time.
1 parent 1643e08 commit 089eb7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

uasyncio.core/uasyncio/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def cancel(self, coro, exc = CancelledError):
7676
prev = coro.pend_throw(exc)
7777
if __debug__ and DEBUG:
7878
log.debug("Cancelling %s asynchronously", coro)
79-
if prev is False:
79+
if prev is None:
8080
_event_loop.remove_polled_cb(coro)
8181
_event_loop.call_soon(coro)
8282
except TypeError:

0 commit comments

Comments
 (0)