Skip to content

Commit a2eb4bf

Browse files
committed
Cleanup gathers
1 parent 24e96f0 commit a2eb4bf

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

pymongo/asynchronous/mongo_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,8 @@ async def close(self) -> None:
15671567
self._closed = True
15681568
if not _IS_SYNC:
15691569
await asyncio.gather(
1570-
*[self._topology.cleanup_monitors(), self._kill_cursors_executor.join()], # type: ignore[func-returns-value]
1570+
self._topology.cleanup_monitors(), # type: ignore[func-returns-value]
1571+
self._kill_cursors_executor.join(), # type: ignore[func-returns-value]
15711572
return_exceptions=True,
15721573
)
15731574

pymongo/asynchronous/monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def gc_safe_close(self) -> None:
191191

192192
async def join(self) -> None:
193193
await asyncio.gather(
194-
*[self._executor.join(), self._rtt_monitor.join()], return_exceptions=True
194+
self._executor.join(), self._rtt_monitor.join(), return_exceptions=True
195195
) # type: ignore[func-returns-value]
196196

197197
async def close(self) -> None:

pymongo/synchronous/mongo_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,8 @@ def close(self) -> None:
15611561
self._closed = True
15621562
if not _IS_SYNC:
15631563
asyncio.gather(
1564-
*[self._topology.cleanup_monitors(), self._kill_cursors_executor.join()], # type: ignore[func-returns-value]
1564+
self._topology.cleanup_monitors(), # type: ignore[func-returns-value]
1565+
self._kill_cursors_executor.join(), # type: ignore[func-returns-value]
15651566
return_exceptions=True,
15661567
)
15671568

pymongo/synchronous/monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def gc_safe_close(self) -> None:
190190
self.cancel_check()
191191

192192
def join(self) -> None:
193-
asyncio.gather(*[self._executor.join(), self._rtt_monitor.join()], return_exceptions=True) # type: ignore[func-returns-value]
193+
asyncio.gather(self._executor.join(), self._rtt_monitor.join(), return_exceptions=True) # type: ignore[func-returns-value]
194194

195195
def close(self) -> None:
196196
self.gc_safe_close()

0 commit comments

Comments
 (0)