Skip to content

Commit 04ccb62

Browse files
committed
Catch a CancelledError and return it if return_exceptions is set
1 parent 95cd442 commit 04ccb62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

asyncio/funcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ async def gather(*aws, return_exceptions=False):
106106
# # cancel all waiting tasks
107107
# raise er
108108
ts[i] = await ts[i]
109-
except Exception as er:
109+
except (core.CancelledError, Exception) as er:
110110
if return_exceptions:
111111
ts[i] = er
112112
else:

0 commit comments

Comments
 (0)