mirror of
https://github.com/python/cpython.git
synced 2025-08-26 11:45:20 +00:00
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().
This commit is contained in:
parent
92f9339a58
commit
a10dc3efcb
7 changed files with 9 additions and 36 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue