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
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import socket
|
||||
import sys
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
@ -36,7 +37,7 @@ class ProactorTests(test_utils.TestCase):
|
|||
self.set_event_loop(self.loop)
|
||||
|
||||
def test_close(self):
|
||||
a, b = self.loop._socketpair()
|
||||
a, b = socket.socketpair()
|
||||
trans = self.loop._make_socket_transport(a, asyncio.Protocol())
|
||||
f = asyncio.ensure_future(self.loop.sock_recv(b, 100))
|
||||
trans.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue