circuitpython/extmod/asyncio
Jim Mussared cfe6a11e39 extmod/asyncio/event.py: Fix ThreadSafeFlag.ioctl return.
iobase_ioctl expects that an ioctl method must return an integer, and will
raise otherwise.

This was tripping up aioble on Unix, where the new hybrid modselect.c
implementation will attempt to extract a file descriptor from the pollable
via ioctl(MP_STREAM_GET_FILENO).

However, ThreadSafeFlag's ioctl only supported MP_STREAM_POLL, and returned
None otherwise.

This makes it return `-1` (to match tests/extmod/select_poll_custom.py). It
should probably be `-22` (corresponding to MP_EINVAL), but the value is
never checked, and MP_EINVAL can be a different value on different ports.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 17:58:40 +10:00
..
__init__.py extmod/asyncio: Rename uasyncio to asyncio. 2023-06-19 17:33:03 +10:00
core.py extmod/asyncio: Rename uasyncio to asyncio. 2023-06-19 17:33:03 +10:00
event.py extmod/asyncio/event.py: Fix ThreadSafeFlag.ioctl return. 2023-09-29 17:58:40 +10:00
funcs.py extmod/asyncio: Rename uasyncio to asyncio. 2023-06-19 17:33:03 +10:00
lock.py extmod/asyncio: Rename uasyncio to asyncio. 2023-06-19 17:33:03 +10:00
manifest.py extmod/asyncio/uasyncio.py: Add backwards-compatible uasyncio alias. 2023-06-19 18:37:34 +10:00
stream.py extmod/asyncio: Rename uasyncio to asyncio. 2023-06-19 17:33:03 +10:00
task.py extmod/asyncio: Rename uasyncio to asyncio. 2023-06-19 17:33:03 +10:00
uasyncio.py extmod/asyncio/uasyncio.py: Add backwards-compatible uasyncio alias. 2023-06-19 18:37:34 +10:00