circuitpython/extmod/asyncio
Jim Mussared 977dc9a369 extmod/asyncio/stream.py: Fix cancellation handling of start_server.
The following code:

  server = await asyncio.start_server(...)
  async with server:
    ... code that raises ...

would lose the original exception because the server's task would not have
had a chance to be scheduled yet, and so awaiting the task in wait_closed
would raise the cancellation instead of the original exception.

Additionally, ensures that explicitly cancelling the parent task delivers
the cancellation correctly (previously was masked by the server loop), now
this only happens if the server was closed, not when the task was
cancelled.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-10-02 14:11:52 +11: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/stream.py: Fix cancellation handling of start_server. 2023-10-02 14:11:52 +11: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