Skip to content

Commit 577cd7f

Browse files
committed
No more slicing fqdn to get parts
1 parent c7f4fef commit 577cd7f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

pymongo/asynchronous/srv_resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __init__(
9292
pass
9393

9494
try:
95-
self.__plist = self.__fqdn.split(".")[1:]
95+
self.__plist = self.__fqdn.split(".")
9696
except Exception:
9797
raise ConfigurationError(_INVALID_HOST_MSG % (fqdn,)) from None
9898
self.__slen = len(self.__plist)

pymongo/synchronous/srv_resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __init__(
9292
pass
9393

9494
try:
95-
self.__plist = self.__fqdn.split(".")[1:]
95+
self.__plist = self.__fqdn.split(".")
9696
except Exception:
9797
raise ConfigurationError(_INVALID_HOST_MSG % (fqdn,)) from None
9898
self.__slen = len(self.__plist)

test/test_uri_parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,10 @@ def mock_resolve(query, record_type, *args, **kwargs):
629629
else:
630630
self.fail(f"ConfigurationError was not raised for query: {case['query']}")
631631

632-
def test_4_throw_when_return_address_does_not_contain_dot_separating_shared_part_of_domain(self):
632+
def test_4_throw_when_return_address_does_not_contain_dot_separating_shared_part_of_domain(
633+
self
634+
):
633635
test_cases = [
634-
635636
{
636637
"query": "_mongodb._tcp.localhost",
637638
"mock_target": "test_1.cluster_1localhost",

0 commit comments

Comments
 (0)