Skip to content

Commit 0ca6afd

Browse files
committed
re-order call to super's init
1 parent 0b6d303 commit 0ca6afd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pymongo/asynchronous/mongo_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,8 +856,6 @@ def __init__(
856856
"condition_class": condition_class,
857857
}
858858
)
859-
if not is_srv:
860-
self._init_based_on_options(seeds, srv_max_hosts, srv_service_name)
861859

862860
super().__init__(
863861
self._options.codec_options,
@@ -866,6 +864,9 @@ def __init__(
866864
self._options.read_concern,
867865
)
868866

867+
if not is_srv:
868+
self._init_based_on_options(seeds, srv_max_hosts, srv_service_name)
869+
869870
self._opened = False
870871
self._closed = False
871872
if not is_srv:

pymongo/synchronous/mongo_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,6 @@ def __init__(
854854
"condition_class": condition_class,
855855
}
856856
)
857-
if not is_srv:
858-
self._init_based_on_options(seeds, srv_max_hosts, srv_service_name)
859857

860858
super().__init__(
861859
self._options.codec_options,
@@ -864,6 +862,9 @@ def __init__(
864862
self._options.read_concern,
865863
)
866864

865+
if not is_srv:
866+
self._init_based_on_options(seeds, srv_max_hosts, srv_service_name)
867+
867868
self._opened = False
868869
self._closed = False
869870
if not is_srv:

0 commit comments

Comments
 (0)