You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
319 B
14 lines
319 B
7 years ago
|
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).
|
||
|
print(repr(e))
|