summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/io_iobase.py
blob: d3824c177f3b33d51be9a32603689f3169a5edcb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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())