Skip to content

Commit 7424f6c

Browse files
authored
PYTHON-5242 MongoClient does not define all attributes in __init__ (#2249)
1 parent 894782e commit 7424f6c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pymongo/asynchronous/mongo_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
)
9292
from pymongo.logger import _CLIENT_LOGGER, _log_client_error, _log_or_warn
9393
from pymongo.message import _CursorAddress, _GetMore, _Query
94-
from pymongo.monitoring import ConnectionClosedReason
94+
from pymongo.monitoring import ConnectionClosedReason, _EventListeners
9595
from pymongo.operations import (
9696
DeleteMany,
9797
DeleteOne,
@@ -759,6 +759,8 @@ def __init__(
759759
self._port = port
760760
self._topology: Topology = None # type: ignore[assignment]
761761
self._timeout: float | None = None
762+
self._topology_settings: TopologySettings = None # type: ignore[assignment]
763+
self._event_listeners: _EventListeners | None = None
762764

763765
# _pool_class, _monitor_class, and _condition_class are for deep
764766
# customization of PyMongo, e.g. Motor.

pymongo/synchronous/mongo_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
)
8484
from pymongo.logger import _CLIENT_LOGGER, _log_client_error, _log_or_warn
8585
from pymongo.message import _CursorAddress, _GetMore, _Query
86-
from pymongo.monitoring import ConnectionClosedReason
86+
from pymongo.monitoring import ConnectionClosedReason, _EventListeners
8787
from pymongo.operations import (
8888
DeleteMany,
8989
DeleteOne,
@@ -757,6 +757,8 @@ def __init__(
757757
self._port = port
758758
self._topology: Topology = None # type: ignore[assignment]
759759
self._timeout: float | None = None
760+
self._topology_settings: TopologySettings = None # type: ignore[assignment]
761+
self._event_listeners: _EventListeners | None = None
760762

761763
# _pool_class, _monitor_class, and _condition_class are for deep
762764
# customization of PyMongo, e.g. Motor.

0 commit comments

Comments
 (0)