diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-09 01:42:52 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-09 01:42:52 +0100 |
commit | b076016e461cdb1819c21d42f1dd337334bdadac (patch) | |
tree | f626fbdcb5a8b5524c77e7b8f917d2ae7916fe56 /Lib/asyncio/selector_events.py | |
parent | 0cff604b0283d2ab9d50227a9f5c3f1c6852dcbd (diff) | |
download | cpython-b076016e461cdb1819c21d42f1dd337334bdadac.tar.gz |
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.
Diffstat (limited to 'Lib/asyncio/selector_events.py')
-rw-r--r-- | Lib/asyncio/selector_events.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index 69b649ceea..58b61f1c89 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(): |