diff --git a/uasyncio_iostream/tests/iotest1.py b/uasyncio_iostream/tests/iotest1.py index 25c98f3..c46b4b5 100644 --- a/uasyncio_iostream/tests/iotest1.py +++ b/uasyncio_iostream/tests/iotest1.py @@ -11,8 +11,7 @@ MP_STREAM_POLL = const(3) MP_STREAM_ERROR = const(-1) def printbuf(this_io): - for ch in this_io.wbuf[:this_io.wprint_len]: - print(chr(ch), end='') + print(bytes(this_io.wbuf[:this_io.wprint_len]).decode(), end='') class MyIO(io.IOBase): def __init__(self): diff --git a/uasyncio_iostream/tests/iotest2.py b/uasyncio_iostream/tests/iotest2.py index 7dc4605..e538305 100644 --- a/uasyncio_iostream/tests/iotest2.py +++ b/uasyncio_iostream/tests/iotest2.py @@ -12,8 +12,7 @@ MP_STREAM_POLL = const(3) MP_STREAM_ERROR = const(-1) def printbuf(this_io): - for ch in this_io.wbuf[:this_io.wprint_len]: - print(chr(ch), end='') + print(bytes(this_io.wbuf[:this_io.wprint_len]).decode(), end='') this_io.wbuf = b'' class MyIO(io.IOBase): diff --git a/uasyncio_iostream/tests/iotest3.py b/uasyncio_iostream/tests/iotest3.py index 74fa44d..cf1e785 100644 --- a/uasyncio_iostream/tests/iotest3.py +++ b/uasyncio_iostream/tests/iotest3.py @@ -51,8 +51,7 @@ class MyIOR(io.IOBase): # a ready status. For the demo it stores the characters in .wbuf for printing. def printbuf(this_io): - for x in range(this_io.wprint_len): - print(chr(this_io.wbuf[x]), end = '') + print(bytes(this_io.wbuf[:this_io.wprint_len]).decode(), end='') class MyIOW(io.IOBase): def __init__(self): diff --git a/uasyncio_iostream/tests/iotest4.py b/uasyncio_iostream/tests/iotest4.py index d28ea06..6b5c77f 100644 --- a/uasyncio_iostream/tests/iotest4.py +++ b/uasyncio_iostream/tests/iotest4.py @@ -20,8 +20,7 @@ MP_STREAM_POLL = const(3) MP_STREAM_ERROR = const(-1) def printbuf(this_io): - for ch in this_io.wbuf[:this_io.wprint_len]: - print(chr(ch), end='') + print(bytes(this_io.wbuf[:this_io.wprint_len]).decode(), end='') class MyIO(io.IOBase): def __init__(self, read=False, write=False): diff --git a/uasyncio_iostream/tests/iotest5.py b/uasyncio_iostream/tests/iotest5.py index b6b0da5..54e4d73 100644 --- a/uasyncio_iostream/tests/iotest5.py +++ b/uasyncio_iostream/tests/iotest5.py @@ -20,8 +20,7 @@ MP_STREAM_POLL = const(3) MP_STREAM_ERROR = const(-1) def printbuf(this_io): - for ch in this_io.wbuf[:this_io.wprint_len]: - print(chr(ch), end='') + print(bytes(this_io.wbuf[:this_io.wprint_len]).decode(), end='') class MyIO(io.IOBase): def __init__(self, read=False, write=False):