mirror of
https://github.com/python/cpython.git
synced 2025-08-27 20:25:18 +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
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue