From: Bob Halley Date: Fri, 23 Dec 2022 17:24:21 +0000 (-0800) Subject: lint X-Git-Tag: v2.3.0rc1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f203c480db9493439e2a00f954f2cd209b601813;p=thirdparty%2Fdnspython.git lint --- diff --git a/dns/dnssec.py b/dns/dnssec.py index d380ea17..5dc26223 100644 --- a/dns/dnssec.py +++ b/dns/dnssec.py @@ -195,7 +195,8 @@ def make_ds( *name*, a ``dns.name.Name`` or ``str``, the owner name of the DS record. - *key*, a ``dns.rdtypes.ANY.DNSKEY.DNSKEY`` or ``dns.rdtypes.ANY.DNSKEY.CDNSKEY``, the key the DS is about. + *key*, a ``dns.rdtypes.ANY.DNSKEY.DNSKEY`` or ``dns.rdtypes.ANY.DNSKEY.CDNSKEY``, + the key the DS is about. *algorithm*, a ``str`` or ``int`` specifying the hash algorithm. The currently supported hashes are "SHA1", "SHA256", and "SHA384". Case @@ -268,7 +269,8 @@ def make_cds( *name*, a ``dns.name.Name`` or ``str``, the owner name of the DS record. - *key*, a ``dns.rdtypes.ANY.DNSKEY.DNSKEY`` or ``dns.rdtypes.ANY.DNSKEY.CDNSKEY``, key the DS is about. + *key*, a ``dns.rdtypes.ANY.DNSKEY.DNSKEY`` or ``dns.rdtypes.ANY.DNSKEY.CDNSKEY``, + the key the DS is about. *algorithm*, a ``str`` or ``int`` specifying the hash algorithm. The currently supported hashes are "SHA1", "SHA256", and "SHA384". Case @@ -1115,7 +1117,7 @@ def make_ds_rdataset( for rdata in cds_rdataset_to_ds_rdataset(rdataset): if rdata.digest_type in _algorithms: res.append(rdata) - if not len(res): + if len(res) == 0: raise ValueError("no acceptable CDS rdata found") return dns.rdataset.from_rdata_list(rdataset.ttl, res)