try:importuioasioexceptImportError:importioa=io.BytesIO(b"foobar")try:a.seek(-10)exceptExceptionase:# CPython throws ValueError, but MicroPython has consistent stream# interface, so BytesIO raises the same error as a real file, which# is OSError(EINVAL).print(repr(e))