2022-08-18 16:57:45 +10:00
|
|
|
import io
|
2018-06-04 16:24:15 +10:00
|
|
|
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())
|