summaryrefslogtreecommitdiff
path: root/tests/io/iobase.py
blob: 667e629858e9cc0920e56d3a7366e124ac1f4924 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
try:
    import uio as io
except:
    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())