diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-28 11:15:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-28 11:15:26 +0100 |
commit | a10dc3efcbba8aa7cc7d1a017f8b22fc4fa8e87c (patch) | |
tree | 6ed634f185e7920ed25ae56e537e0202b675f7c9 /Lib/asyncio/selector_events.py | |
parent | 92f9339a58a613a56683510499509d1b702921a8 (diff) | |
download | cpython-a10dc3efcbba8aa7cc7d1a017f8b22fc4fa8e87c.tar.gz cpython-a10dc3efcbba8aa7cc7d1a017f8b22fc4fa8e87c.zip |
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().
Diffstat (limited to 'Lib/asyncio/selector_events.py')
-rw-r--r-- | Lib/asyncio/selector_events.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index 4baad48ce39..ef6f0ac458d 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -96,9 +96,6 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop): self._selector.close() self._selector = None - def _socketpair(self): - raise NotImplementedError - def _close_self_pipe(self): self._remove_reader(self._ssock.fileno()) self._ssock.close() @@ -109,7 +106,7 @@ class BaseSelectorEventLoop(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 |