diff options
author | Brian Wellington <bwelling@xbill.org> | 2023-04-11 11:05:16 -0700 |
---|---|---|
committer | Brian Wellington <bwelling@xbill.org> | 2023-04-11 11:05:16 -0700 |
commit | 1db18b95597fb0fb70081d394246a1c73a2cc3ae (patch) | |
tree | b3164d650f63ef8c1117c17c4abc6fbfd1ec8c34 | |
parent | 0988d6af5a73d7715ea64e97443b1a53138f8b5e (diff) | |
download | dnspython-1db18b95597fb0fb70081d394246a1c73a2cc3ae.tar.gz |
Remove unnecessary string concatenation.
-rw-r--r-- | dns/asyncbackend.py | 4 | ||||
-rw-r--r-- | dns/dnssec.py | 2 | ||||
-rw-r--r-- | dns/query.py | 2 | ||||
-rw-r--r-- | dns/resolver.py | 2 | ||||
-rw-r--r-- | dns/transaction.py | 4 | ||||
-rw-r--r-- | dns/tsig.py | 4 |
6 files changed, 7 insertions, 11 deletions
diff --git a/dns/asyncbackend.py b/dns/asyncbackend.py index e889ce7..b6d3211 100644 --- a/dns/asyncbackend.py +++ b/dns/asyncbackend.py @@ -69,9 +69,7 @@ def sniff() -> str: 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 diff --git a/dns/dnssec.py b/dns/dnssec.py index c219965..0c19ee8 100644 --- a/dns/dnssec.py +++ b/dns/dnssec.py @@ -1444,7 +1444,7 @@ def _sign_zone_nsec( def _need_pyca(*args, **kwargs): raise ImportError( - "DNSSEC validation requires " + "python cryptography" + "DNSSEC validation requires python cryptography" ) # pragma: no cover diff --git a/dns/query.py b/dns/query.py index c4bd75e..1a1b566 100644 --- a/dns/query.py +++ b/dns/query.py @@ -317,7 +317,7 @@ def _destination_and_source( # 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, diff --git a/dns/resolver.py b/dns/resolver.py index 5788c95..c28c137 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -187,7 +187,7 @@ Timeout = LifetimeTimeout 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 diff --git a/dns/transaction.py b/dns/transaction.py index 91ed732..37aa37a 100644 --- a/dns/transaction.py +++ b/dns/transaction.py @@ -437,7 +437,7 @@ class Transaction: 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") @@ -496,7 +496,7 @@ class Transaction: 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: diff --git a/dns/tsig.py b/dns/tsig.py index 2476fdf..ca3be59 100644 --- a/dns/tsig.py +++ b/dns/tsig.py @@ -187,9 +187,7 @@ class HMACTSig: 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): |