2023-08-22 11:15:46 -04:00
|
|
|
import io
|
2017-08-20 14:57:36 -04:00
|
|
|
|
|
|
|
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).
|
2018-04-30 21:59:23 -04:00
|
|
|
print(type(e), e.args[0] > 0)
|