2017-08-20 12:57:36 -06:00
|
|
|
try:
|
|
|
|
import uio as io
|
|
|
|
except ImportError:
|
|
|
|
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).
|
2018-04-30 19:59:23 -06:00
|
|
|
print(type(e), e.args[0] > 0)
|