From 23153181d87202cce43197a1720b670236c9eba4 Mon Sep 17 00:00:00 2001 From: Iris Ho Date: Mon, 31 Mar 2025 16:53:57 -0700 Subject: [PATCH] add missing attributes to init --- pymongo/asynchronous/mongo_client.py | 4 +++- pymongo/synchronous/mongo_client.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pymongo/asynchronous/mongo_client.py b/pymongo/asynchronous/mongo_client.py index 16753420c0..98b8204d93 100644 --- a/pymongo/asynchronous/mongo_client.py +++ b/pymongo/asynchronous/mongo_client.py @@ -91,7 +91,7 @@ ) from pymongo.logger import _CLIENT_LOGGER, _log_client_error, _log_or_warn from pymongo.message import _CursorAddress, _GetMore, _Query -from pymongo.monitoring import ConnectionClosedReason +from pymongo.monitoring import ConnectionClosedReason, _EventListeners from pymongo.operations import ( DeleteMany, DeleteOne, @@ -759,6 +759,8 @@ def __init__( self._port = port self._topology: Topology = None # type: ignore[assignment] self._timeout: float | None = None + self._topology_settings: TopologySettings = None # type: ignore[assignment] + self._event_listeners: _EventListeners | None = None # _pool_class, _monitor_class, and _condition_class are for deep # customization of PyMongo, e.g. Motor. diff --git a/pymongo/synchronous/mongo_client.py b/pymongo/synchronous/mongo_client.py index 2d8d6d730b..170798e9f9 100644 --- a/pymongo/synchronous/mongo_client.py +++ b/pymongo/synchronous/mongo_client.py @@ -83,7 +83,7 @@ ) from pymongo.logger import _CLIENT_LOGGER, _log_client_error, _log_or_warn from pymongo.message import _CursorAddress, _GetMore, _Query -from pymongo.monitoring import ConnectionClosedReason +from pymongo.monitoring import ConnectionClosedReason, _EventListeners from pymongo.operations import ( DeleteMany, DeleteOne, @@ -757,6 +757,8 @@ def __init__( self._port = port self._topology: Topology = None # type: ignore[assignment] self._timeout: float | None = None + self._topology_settings: TopologySettings = None # type: ignore[assignment] + self._event_listeners: _EventListeners | None = None # _pool_class, _monitor_class, and _condition_class are for deep # customization of PyMongo, e.g. Motor.