extmod/uasyncio: Add StreamReader/StreamWriter as aliases of Stream cls.

To be compatible with CPython.  Fixes issue #5847.
This commit is contained in:
Damien George
2020-04-02 00:51:00 +11:00
parent aca19c25d2
commit f97b5395ed
3 changed files with 9 additions and 1 deletions

View File

@@ -12,6 +12,8 @@ _attrs = {
"Lock": "lock",
"open_connection": "stream",
"start_server": "stream",
"StreamReader": "stream",
"StreamWriter": "stream",
}
# Lazy loader, effectively does:

View File

@@ -53,6 +53,11 @@ class Stream:
self.out_buf = b""
# Stream can be used for both reading and writing to save code size
StreamReader = Stream
StreamWriter = Stream
# Create a TCP stream connection to a remote host
async def open_connection(host, port):
from uerrno import EINPROGRESS