Kaydet (Commit) efef9d3f authored tarafından Guido van Rossum's avatar Guido van Rossum

asyncio: Tiny cleanup in streams.py.

üst 2407f3bb
...@@ -38,7 +38,7 @@ def open_connection(host=None, port=None, *, ...@@ -38,7 +38,7 @@ def open_connection(host=None, port=None, *,
if loop is None: if loop is None:
loop = events.get_event_loop() loop = events.get_event_loop()
reader = StreamReader(limit=limit, loop=loop) reader = StreamReader(limit=limit, loop=loop)
protocol = StreamReaderProtocol(reader) protocol = StreamReaderProtocol(reader, loop=loop)
transport, _ = yield from loop.create_connection( transport, _ = yield from loop.create_connection(
lambda: protocol, host, port, **kwds) lambda: protocol, host, port, **kwds)
writer = StreamWriter(transport, protocol, reader, loop) writer = StreamWriter(transport, protocol, reader, loop)
...@@ -151,7 +151,7 @@ class StreamWriter: ...@@ -151,7 +151,7 @@ class StreamWriter:
This exposes write(), writelines(), [can_]write_eof(), This exposes write(), writelines(), [can_]write_eof(),
get_extra_info() and close(). It adds drain() which returns an get_extra_info() and close(). It adds drain() which returns an
optional Future on which you can wait for flow control. It also optional Future on which you can wait for flow control. It also
adds a transport attribute which references the Transport adds a transport property which references the Transport
directly. directly.
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment