summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/io_bytesio_ext2.py
blob: 414ac90a3b0836ecef2ea8ed1b08cbee0ea496c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
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)