try:
return sniffio.current_async_library()
except sniffio.AsyncLibraryNotFoundError:
- raise AsyncLibraryNotFoundError(
- "sniffio cannot determine " + "async library"
- )
+ raise AsyncLibraryNotFoundError("sniffio cannot determine async library")
except ImportError:
import asyncio
def _need_pyca(*args, **kwargs):
raise ImportError(
- "DNSSEC validation requires " + "python cryptography"
+ "DNSSEC validation requires python cryptography"
) # pragma: no cover
# We know the destination af, so source had better agree!
if saf != af:
raise ValueError(
- "different address families for source " + "and destination"
+ "different address families for source and destination"
)
else:
# We didn't know the destination af, but we know the source,
class NoAnswer(dns.exception.DNSException):
"""The DNS response does not contain an answer to the question."""
- fmt = "The DNS response does not contain an answer " + "to the question: {query}"
+ fmt = "The DNS response does not contain an answer to the question: {query}"
supp_kwargs = {"response"}
# We do this as otherwise mypy complains about unexpected keyword argument
rdataset = rrset.to_rdataset()
else:
raise TypeError(
- f"{method} requires a name or RRset " + "as the first argument"
+ f"{method} requires a name or RRset as the first argument"
)
if rdataset.rdclass != self.manager.get_class():
raise ValueError(f"{method} has objects of wrong RdataClass")
name = rdataset.name
else:
raise TypeError(
- f"{method} requires a name or RRset " + "as the first argument"
+ f"{method} requires a name or RRset as the first argument"
)
self._raise_if_not_empty(method, args)
if rdataset:
try:
hashinfo = self._hashes[algorithm]
except KeyError:
- raise NotImplementedError(
- f"TSIG algorithm {algorithm} " + "is not supported"
- )
+ raise NotImplementedError(f"TSIG algorithm {algorithm} is not supported")
# create the HMAC context
if isinstance(hashinfo, tuple):