@@ -43,8 +43,6 @@ def close(self):
43
43
async def wait_closed (self ):
44
44
# CIRCUITPY-CHANGE: doc
45
45
"""Wait for the stream to close.
46
-
47
- This is a coroutine.
48
46
"""
49
47
50
48
# TODO yield?
@@ -54,8 +52,6 @@ async def wait_closed(self):
54
52
async def read (self , n ):
55
53
# CIRCUITPY-CHANGE: doc
56
54
"""Read up to *n* bytes and return them.
57
-
58
- This is a coroutine.
59
55
"""
60
56
61
57
await core ._io_queue .queue_read (self .s )
@@ -67,7 +63,7 @@ async def readinto(self, buf):
67
63
68
64
Return the number of bytes read into *buf*
69
65
70
- This is a coroutine, and a MicroPython extension.
66
+ This is a MicroPython extension.
71
67
"""
72
68
73
69
# CIRCUITPY-CHANGE: await, not yield
@@ -81,9 +77,7 @@ async def readexactly(self, n):
81
77
82
78
Raises an ``EOFError`` exception if the stream ends before reading
83
79
*n* bytes.
84
-
85
- This is a coroutine.
86
- """
80
+ """
87
81
88
82
r = b""
89
83
while n :
@@ -101,8 +95,6 @@ async def readexactly(self, n):
101
95
async def readline (self ):
102
96
# CIRCUITPY-CHANGE: doc
103
97
"""Read a line and return it.
104
-
105
- This is a coroutine.
106
98
"""
107
99
108
100
l = b""
@@ -133,8 +125,6 @@ def write(self, buf):
133
125
async def drain (self ):
134
126
# CIRCUITPY-CHANGE: doc
135
127
"""Drain (write) all buffered output data out to the stream.
136
-
137
- This is a coroutine.
138
128
"""
139
129
140
130
mv = memoryview (self .out_buf )
@@ -162,8 +152,6 @@ async def open_connection(host, port, ssl=None, server_hostname=None):
162
152
163
153
Returns a pair of streams: a reader and a writer stream. Will raise a socket-specific
164
154
``OSError`` if the host could not be resolved or if the connection could not be made.
165
-
166
- This is a coroutine.
167
155
"""
168
156
169
157
from uerrno import EINPROGRESS
@@ -188,7 +176,7 @@ async def open_connection(host, port, ssl=None, server_hostname=None):
188
176
s = ssl .wrap_socket (s , server_hostname = server_hostname , do_handshake_on_connect = False )
189
177
s .setblocking (False )
190
178
ss = Stream (s )
191
- yield core ._io_queue .queue_write (s )
179
+ await core ._io_queue .queue_write (s )
192
180
return ss , ss
193
181
194
182
@@ -214,8 +202,6 @@ def close(self):
214
202
215
203
async def wait_closed (self ):
216
204
"""Wait for the server to close.
217
-
218
- This is a coroutine.
219
205
"""
220
206
221
207
await self .task
@@ -263,8 +249,6 @@ async def start_server(cb, host, port, backlog=5):
263
249
writer streams for the connection.
264
250
265
251
Returns a `Server` object.
266
-
267
- This is a coroutine.
268
252
"""
269
253
270
254
import socket
0 commit comments