diff options
author | Bob Halley <halley@dnspython.org> | 2021-07-10 15:28:59 -0700 |
---|---|---|
committer | Bob Halley <halley@dnspython.org> | 2021-07-10 15:28:59 -0700 |
commit | be479d0f89a0f3fa1e9a4ced7c4a756b346f4075 (patch) | |
tree | 1ffcd3f33f045dda2bff91044cc09ff6c0d36d53 | |
parent | 7e79e390825ece521abbf88937aaae94906876cf (diff) | |
download | dnspython-be479d0f89a0f3fa1e9a4ced7c4a756b346f4075.tar.gz |
avoid compatibility warnings for python 3.12
-rw-r--r-- | dns/rdata.py | 2 | ||||
-rw-r--r-- | dns/rdtypes/svcbbase.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/dns/rdata.py b/dns/rdata.py index 18e93cf..2da314b 100644 --- a/dns/rdata.py +++ b/dns/rdata.py @@ -687,7 +687,7 @@ def from_wire(rdclass, rdtype, wire, current, rdlen, origin=None): class RdatatypeExists(dns.exception.DNSException): """DNS rdatatype already exists.""" supp_kwargs = {'rdclass', 'rdtype'} - fmt = "The rdata type with class {rdclass} and rdtype {rdtype} " + \ + fmt = "The rdata type with class {rdclass:d} and rdtype {rdtype:d} " + \ "already exists." diff --git a/dns/rdtypes/svcbbase.py b/dns/rdtypes/svcbbase.py index 2c76a58..09d7a52 100644 --- a/dns/rdtypes/svcbbase.py +++ b/dns/rdtypes/svcbbase.py @@ -198,7 +198,7 @@ class MandatoryParam(Param): prior_k = None for k in keys: if k == prior_k: - raise ValueError(f'duplicate key {k}') + raise ValueError(f'duplicate key {k:d}') prior_k = k if k == ParamKey.MANDATORY: raise ValueError('listed the mandatory key as mandatory') @@ -402,7 +402,7 @@ _class_for_key = { def _validate_and_define(params, key, value): (key, force_generic) = _validate_key(_unescape(key)) if key in params: - raise SyntaxError(f'duplicate key "{key}"') + raise SyntaxError(f'duplicate key "{key:d}"') cls = _class_for_key.get(key, GenericParam) emptiness = cls.emptiness() if value is None: @@ -443,7 +443,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} declared mandatory but not ' + 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: |