mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)
See https://bugs.python.org/issue38242 for more details
This commit is contained in:
parent
3667e1ee6c
commit
6758e6e12a
13 changed files with 381 additions and 2755 deletions
|
@ -15,7 +15,6 @@ import _winapi
|
|||
|
||||
import asyncio
|
||||
from asyncio import windows_events
|
||||
from asyncio.streams import _StreamProtocol
|
||||
from test.test_asyncio import utils as test_utils
|
||||
|
||||
|
||||
|
@ -118,16 +117,14 @@ class ProactorTests(test_utils.TestCase):
|
|||
|
||||
clients = []
|
||||
for i in range(5):
|
||||
stream = asyncio.Stream(mode=asyncio.StreamMode.READ,
|
||||
loop=self.loop, _asyncio_internal=True)
|
||||
protocol = _StreamProtocol(stream,
|
||||
loop=self.loop,
|
||||
_asyncio_internal=True)
|
||||
stream_reader = asyncio.StreamReader(loop=self.loop)
|
||||
protocol = asyncio.StreamReaderProtocol(stream_reader,
|
||||
loop=self.loop)
|
||||
trans, proto = await self.loop.create_pipe_connection(
|
||||
lambda: protocol, ADDRESS)
|
||||
self.assertIsInstance(trans, asyncio.Transport)
|
||||
self.assertEqual(protocol, proto)
|
||||
clients.append((stream, trans))
|
||||
clients.append((stream_reader, trans))
|
||||
|
||||
for i, (r, w) in enumerate(clients):
|
||||
w.write('lower-{}\n'.format(i).encode())
|
||||
|
@ -136,7 +133,6 @@ class ProactorTests(test_utils.TestCase):
|
|||
response = await r.readline()
|
||||
self.assertEqual(response, 'LOWER-{}\n'.format(i).encode())
|
||||
w.close()
|
||||
await r.close()
|
||||
|
||||
server.close()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue