From: Bob Halley Date: Thu, 17 Mar 2022 12:29:55 +0000 (-0700) Subject: join adjacent strings (formatting) X-Git-Tag: v2.3.0rc1~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fe1ebae6964feb93b98671fdb1d6d36d13abeb2;p=thirdparty%2Fdnspython.git join adjacent strings (formatting) --- diff --git a/dns/message.py b/dns/message.py index 967fefea..709d71dd 100644 --- a/dns/message.py +++ b/dns/message.py @@ -1073,7 +1073,7 @@ class _WireReader: self.message.opt = dns.rrset.from_rdata(name, ttl, rd) elif rdtype == dns.rdatatype.TSIG: if self.keyring is None: - raise UnknownTSIGKey("got signed message without " "keyring") + raise UnknownTSIGKey("got signed message without keyring") if isinstance(self.keyring, dict): key = self.keyring.get(absolute_name) if isinstance(key, bytes): diff --git a/dns/query.py b/dns/query.py index 2c3da4f8..493d283c 100644 --- a/dns/query.py +++ b/dns/query.py @@ -239,7 +239,7 @@ def _destination_and_source( elif af == socket.AF_INET6: source = "::" else: - raise ValueError("source_port specified but address family is " "unknown") + raise ValueError("source_port specified but address family is unknown") # Convert high-level (address, port) tuples into low-level address # tuples. if destination: @@ -376,7 +376,7 @@ def https( if not _httpx_ok and not _have_requests: raise NoDOH( - "Cannot use httpx for this operation, and " "requests is not available." + "Cannot use httpx for this operation, and requests is not available." ) with contextlib.ExitStack() as stack: diff --git a/dns/rdtypes/svcbbase.py b/dns/rdtypes/svcbbase.py index a7bc2739..b7e7a858 100644 --- a/dns/rdtypes/svcbbase.py +++ b/dns/rdtypes/svcbbase.py @@ -450,9 +450,7 @@ class SVCBBase(dns.rdata.Rdata): # Note we have to say "not in" as we have None as a value # so a get() and a not None test would be wrong. if key not in params: - raise ValueError( - f"key {key:d} declared mandatory but not " "present" - ) + raise ValueError(f"key {key:d} declared mandatory but not present") # The no-default-alpn parameter requires the alpn parameter. if ParamKey.NO_DEFAULT_ALPN in params: if ParamKey.ALPN not in params: diff --git a/dns/resolver.py b/dns/resolver.py index f9303692..3b76100c 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -1115,7 +1115,7 @@ class BaseResolver: self._nameservers = nameservers else: raise ValueError( - "nameservers must be a list" " (not a {})".format(type(nameservers)) + "nameservers must be a list (not a {})".format(type(nameservers)) ) diff --git a/dns/transaction.py b/dns/transaction.py index b0429dfb..c4a9e1f6 100644 --- a/dns/transaction.py +++ b/dns/transaction.py @@ -480,7 +480,7 @@ class Transaction: self._raise_if_not_empty(method, args) if rdataset: if rdataset.rdclass != self.manager.get_class(): - raise ValueError(f"{method} has objects of wrong " "RdataClass") + raise ValueError(f"{method} has objects of wrong RdataClass") existing = self._get_rdataset(name, rdataset.rdtype, rdataset.covers) if existing is not None: if exact: diff --git a/dns/xfr.py b/dns/xfr.py index 89e92caf..bb165888 100644 --- a/dns/xfr.py +++ b/dns/xfr.py @@ -117,9 +117,7 @@ class Inbound: # the origin. # if not message.answer or message.answer[0].name != self.origin: - raise dns.exception.FormError( - "No answer or RRset not " "for zone origin" - ) + raise dns.exception.FormError("No answer or RRset not for zone origin") rrset = message.answer[0] rdataset = rrset if rdataset.rdtype != dns.rdatatype.SOA: @@ -183,9 +181,7 @@ class Inbound: self.rdtype == dns.rdatatype.IXFR and self.serial != rdataset[0].serial ): - raise dns.exception.FormError( - "unexpected end of IXFR " "sequence" - ) + raise dns.exception.FormError("unexpected end of IXFR sequence") self.txn.replace(name, rdataset) self.txn.commit() self.txn = None @@ -208,9 +204,7 @@ class Inbound: self.txn.replace(name, rdataset) else: # We saw a non-final SOA for the origin in an AXFR. - raise dns.exception.FormError( - "unexpected origin SOA " "in AXFR" - ) + raise dns.exception.FormError("unexpected origin SOA in AXFR") continue if self.expecting_SOA: # diff --git a/dns/zone.py b/dns/zone.py index d0d99284..cba2e54f 100644 --- a/dns/zone.py +++ b/dns/zone.py @@ -121,9 +121,7 @@ class Zone(dns.transaction.TransactionManager): if isinstance(origin, str): origin = dns.name.from_text(origin) elif not isinstance(origin, dns.name.Name): - raise ValueError( - "origin parameter must be convertible to a " "DNS name" - ) + raise ValueError("origin parameter must be convertible to a DNS name") if not origin.is_absolute(): raise ValueError("origin parameter must be an absolute name") self.origin = origin diff --git a/dns/zonefile.py b/dns/zonefile.py index fd17073d..4e0013a6 100644 --- a/dns/zonefile.py +++ b/dns/zonefile.py @@ -55,13 +55,13 @@ def _check_cname_and_other_data(txn, name, rdataset): node_kind == dns.node.NodeKind.CNAME and rdataset_kind == dns.node.NodeKind.REGULAR ): - raise CNAMEAndOtherData("rdataset type is not compatible with a " "CNAME node") + raise CNAMEAndOtherData("rdataset type is not compatible with a CNAME node") elif ( node_kind == dns.node.NodeKind.REGULAR and rdataset_kind == dns.node.NodeKind.CNAME ): raise CNAMEAndOtherData( - "CNAME rdataset is not compatible with a " "regular data node" + "CNAME rdataset is not compatible with a regular data node" ) # Otherwise at least one of the node and the rdataset is neutral, so # adding the rdataset is ok