From a10dc3efcbba8aa7cc7d1a017f8b22fc4fa8e87c Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 28 Nov 2017 11:15:26 +0100 Subject: asyncio: use directly socket.socketpair() (#4597) Since Python 3.5, socket.socketpair() is also available on Windows, and so can be used directly, rather than using asyncio.windows_utils.socketpair(). --- Lib/asyncio/proactor_events.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Lib/asyncio/proactor_events.py') diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py index e35d05b7bf0..d7aa5ff3017 100644 --- a/Lib/asyncio/proactor_events.py +++ b/Lib/asyncio/proactor_events.py @@ -446,9 +446,6 @@ class BaseProactorEventLoop(base_events.BaseEventLoop): def sock_accept(self, sock): return self._proactor.accept(sock) - def _socketpair(self): - raise NotImplementedError - def _close_self_pipe(self): if self._self_reading_future is not None: self._self_reading_future.cancel() @@ -461,7 +458,7 @@ class BaseProactorEventLoop(base_events.BaseEventLoop): def _make_self_pipe(self): # A self-socket, really. :-) - self._ssock, self._csock = self._socketpair() + self._ssock, self._csock = socket.socketpair() self._ssock.setblocking(False) self._csock.setblocking(False) self._internal_fds += 1 -- cgit v1.2.3