diff --git a/uvloop/loop.pyx b/uvloop/loop.pyx index 9ebf3a63..f14e3a36 100644 --- a/uvloop/loop.pyx +++ b/uvloop/loop.pyx @@ -975,7 +975,7 @@ cdef class Loop: if UVLOOP_DEBUG: if fut.cancelled(): - # Shouldn't happen with _SyncSocketReaderFuture. + # Shouldn't happen with _SyncSocketWriterFuture. raise RuntimeError( f'_sock_sendall is called on a cancelled Future') @@ -1059,7 +1059,8 @@ cdef class Loop: return fut cdef _sock_connect_cb(self, fut, sock, address): - if fut.cancelled(): + if fut.done(): + # Refs #378: this may be called multiple times. return try: