Skip to content

Commit 6043d91

Browse files
authored
Fix closing of connection discarded by session target attrs (#1046)
`asyncio.gather` takes a variadic, not an iterable and `return_exceptions` was masking the issue.
1 parent faa94d1 commit 6043d91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

asyncpg/connect_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ async def _connect(*, loop, timeout, connection_class, record_class, **kwargs):
10031003
chosen_connection = random.choice(candidates)
10041004

10051005
await asyncio.gather(
1006-
(c.close() for c in candidates if c is not chosen_connection),
1006+
*(c.close() for c in candidates if c is not chosen_connection),
10071007
return_exceptions=True
10081008
)
10091009

0 commit comments

Comments
 (0)