diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-28 10:15:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-28 10:15:26 (GMT) |
commit | a10dc3efcbba8aa7cc7d1a017f8b22fc4fa8e87c (patch) | |
tree | 6ed634f185e7920ed25ae56e537e0202b675f7c9 /Lib/asyncio/unix_events.py | |
parent | 92f9339a58a613a56683510499509d1b702921a8 (diff) | |
download | cpython-a10dc3efcbba8aa7cc7d1a017f8b22fc4fa8e87c.zip cpython-a10dc3efcbba8aa7cc7d1a017f8b22fc4fa8e87c.tar.gz cpython-a10dc3efcbba8aa7cc7d1a017f8b22fc4fa8e87c.tar.bz2 |
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/unix_events.py')
-rw-r--r-- | Lib/asyncio/unix_events.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index be98f33..94157f8 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -55,9 +55,6 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop): super().__init__(selector) self._signal_handlers = {} - def _socketpair(self): - return socket.socketpair() - def close(self): super().close() for sig in list(self._signal_handlers): @@ -677,7 +674,7 @@ class _UnixSubprocessTransport(base_subprocess.BaseSubprocessTransport): # socket (which we use in order to detect closing of the # other end). Notably this is needed on AIX, and works # just fine on other platforms. - stdin, stdin_w = self._loop._socketpair() + stdin, stdin_w = socket.socketpair() # Mark the write end of the stdin pipe as non-inheritable, # needed by close_fds=False on Python 3.3 and older |