mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 20:50:14 +01:00
extmod/uasyncio: Handle gather with no awaitables.
This previously resulted in gather() yielding but with no way to be resumed. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
committed by
Damien George
parent
092784da19
commit
b22abcdbbe
@@ -53,6 +53,11 @@ async def main():
|
||||
|
||||
print("====")
|
||||
|
||||
# Gather with no awaitables
|
||||
print(await asyncio.gather())
|
||||
|
||||
print("====")
|
||||
|
||||
# Test return_exceptions, where one task is cancelled and the other finishes normally
|
||||
tasks = [asyncio.create_task(task(1)), asyncio.create_task(task(2))]
|
||||
tasks[0].cancel()
|
||||
|
||||
@@ -9,6 +9,8 @@ Task C: Compute factorial(4)...
|
||||
Task C: factorial(4) = 24
|
||||
[2, 6, 24]
|
||||
====
|
||||
[]
|
||||
====
|
||||
start 2
|
||||
end 2
|
||||
[CancelledError(), 2]
|
||||
|
||||
Reference in New Issue
Block a user