extmod/uasyncio: Fix gather returning exceptions from a cancelled task.

Fixes issue #5882.
This commit is contained in:
Damien George
2021-11-17 13:45:42 +11:00
parent 5cf71b5596
commit 43d08688c3
3 changed files with 12 additions and 3 deletions

View File

@@ -66,7 +66,7 @@ async def gather(*aws, return_exceptions=False):
# # cancel all waiting tasks
# raise er
ts[i] = await ts[i]
except Exception as er:
except (core.CancelledError, Exception) as er:
if return_exceptions:
ts[i] = er
else: