mirror of
https://github.com/micropython/micropython.git
synced 2025-09-06 09:50:20 +02:00
Instead of using a feature check. This is more consistent with how other optional modules are skipped. Signed-off-by: Damien George <damien@micropython.org>
15 lines
352 B
Python
15 lines
352 B
Python
try:
|
|
import io
|
|
except ImportError:
|
|
print("SKIP")
|
|
raise SystemExit
|
|
|
|
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)
|