From 3531d9044dbfd15b3bf5ec1abe5b9744fce37464 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 9 Jan 2015 01:42:52 +0100 Subject: asyncio: sync with Tulip * Document why set_result() calls are safe * Cleanup gather(). Use public methods instead of hacks to consume the exception of a future. * sock_connect(): pass directly the fd to _sock_connect_done instead of the socket. --- Lib/asyncio/selector_events.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Lib/asyncio/selector_events.py') diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index 69b649ceeae..58b61f1c89e 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -363,15 +363,15 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop): break except BlockingIOError: fut.add_done_callback(functools.partial(self._sock_connect_done, - sock)) + fd)) self.add_writer(fd, self._sock_connect_cb, fut, sock, address) except Exception as exc: fut.set_exception(exc) else: fut.set_result(None) - def _sock_connect_done(self, sock, fut): - self.remove_writer(sock.fileno()) + def _sock_connect_done(self, fd, fut): + self.remove_writer(fd) def _sock_connect_cb(self, fut, sock, address): if fut.cancelled(): -- cgit v1.2.3