diff --git a/pymongo/pool_shared.py b/pymongo/pool_shared.py index ebb84c3f8..1ad84478d 100644 --- a/pymongo/pool_shared.py +++ b/pymongo/pool_shared.py @@ -360,9 +360,10 @@ async def _configured_protocol_interface( return AsyncNetworkingInterface((transport, protocol)) finally: - # If cancellation or any exception lands between sock creation and + # If cancellation or any exception lands between socket creation and # transport adoption, asyncio.create_connection has not registered - # cleanup for the sock — close it ourselves so it doesn't leak. + # cleanup for the sock. + # Close it ourselves to prevent leaks. if not sock_adopted: sock.close()