PYTHON-4827 - Fix dnspython typechecking failures (#1903)

Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
This commit is contained in:
Noah Stapp 2024-10-08 15:14:54 -04:00 committed by GitHub
parent 5a66e99254
commit d21a8ddcff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -99,7 +99,7 @@ class _SrvResolver:
raise ConfigurationError(str(exc)) from None
if len(results) > 1:
raise ConfigurationError("Only one TXT record is supported")
return (b"&".join([b"".join(res.strings) for res in results])).decode("utf-8")
return (b"&".join([b"".join(res.strings) for res in results])).decode("utf-8") # type: ignore[attr-defined]
def _resolve_uri(self, encapsulate_errors: bool) -> resolver.Answer:
try:
@ -121,7 +121,8 @@ class _SrvResolver:
# Construct address tuples
nodes = [
(maybe_decode(res.target.to_text(omit_final_dot=True)), res.port) for res in results
(maybe_decode(res.target.to_text(omit_final_dot=True)), res.port) # type: ignore[attr-defined]
for res in results
]
# Validate hosts