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

10 lines
283 B
Python

import io
a = io.BytesIO(b"foobar")
try:
a.seek(-10)
except Exception as e:
# CPython throws ValueError, but MicroPython has consistent stream
# interface, so BytesIO raises the same error as a real file, which
# is OSError(EINVAL).
print(type(e), e.args[0] > 0)