diff --git a/a_sync/_smart.pyx b/a_sync/_smart.pyx index 978ddb69..ab41a6e7 100644 --- a/a_sync/_smart.pyx +++ b/a_sync/_smart.pyx @@ -79,14 +79,13 @@ class _SmartFutureMixin(Generic[T]): cdef Py_ssize_t count_waiters(fut: Union["SmartFuture", "SmartTask"]): - cdef WeakSet waiters if _is_done(fut): return ZERO try: waiters = fut._waiters except AttributeError: return ONE - cdef Py_ssize_t count = 0 + cdef Py_ssize_t count = ZERO for waiter in waiters: count += count_waiters(waiter) return count