circuitpython/tests/basics/io_iobase.py
2023-08-22 12:57:47 -04:00

18 lines
306 B
Python

import io
try:
io.IOBase
except AttributeError:
print("SKIP")
raise SystemExit
class MyIO(io.IOBase):
def write(self, buf):
# CPython and uPy pass in different types for buf (str vs bytearray)
print("write", len(buf))
return len(buf)
print("test", file=MyIO())