diff options
author | Damien George <damien@micropython.org> | 2024-11-13 14:21:29 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-11-18 23:27:13 +1100 |
commit | 20a6d82872263e0ef20de7c71b62456907244596 (patch) | |
tree | f96c241e9710461253aff2260a214472187b94e1 /tests/extmod/uasyncio_micropython.py | |
parent | 0c580f71aedac16045f0ecad9cb586aa389d9cff (diff) | |
download | micropython-20a6d82872263e0ef20de7c71b62456907244596.tar.gz micropython-20a6d82872263e0ef20de7c71b62456907244596.zip |
extmod/vfs_blockdev: Support bool return from Python read/write blocks.
Commit f4ab9d924790581989f2398fe30bbac5d680577f inadvertently broke some
Python block devices, for example esp32 and stm32 SDCard classes. Those
classes return a bool from their `readblocks` and `writeblocks` methods
instead of an integer errno code. With that change, both `False` and
`True` return values are now be interpreted as non-zero and hence the block
device call fails.
The fix in this commit is to allow a bool and explicitly convert `True` to
0 and `False` to `-MP_EIO`.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/extmod/uasyncio_micropython.py')
0 files changed, 0 insertions, 0 deletions