Skip to content

Commit d21a8dd

Browse files
NoahStappblink1073
andauthored
PYTHON-4827 - Fix dnspython typechecking failures (#1903)
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
1 parent 5a66e99 commit d21a8dd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pymongo/srv_resolver.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def get_options(self) -> Optional[str]:
9999
raise ConfigurationError(str(exc)) from None
100100
if len(results) > 1:
101101
raise ConfigurationError("Only one TXT record is supported")
102-
return (b"&".join([b"".join(res.strings) for res in results])).decode("utf-8")
102+
return (b"&".join([b"".join(res.strings) for res in results])).decode("utf-8") # type: ignore[attr-defined]
103103

104104
def _resolve_uri(self, encapsulate_errors: bool) -> resolver.Answer:
105105
try:
@@ -121,7 +121,8 @@ def _get_srv_response_and_hosts(
121121

122122
# Construct address tuples
123123
nodes = [
124-
(maybe_decode(res.target.to_text(omit_final_dot=True)), res.port) for res in results
124+
(maybe_decode(res.target.to_text(omit_final_dot=True)), res.port) # type: ignore[attr-defined]
125+
for res in results
125126
]
126127

127128
# Validate hosts

0 commit comments

Comments
 (0)