]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
avoid compatibility warnings for python 3.12
authorBob Halley <halley@dnspython.org>
Sat, 10 Jul 2021 22:28:59 +0000 (15:28 -0700)
committerBob Halley <halley@dnspython.org>
Sat, 10 Jul 2021 22:28:59 +0000 (15:28 -0700)
dns/rdata.py
dns/rdtypes/svcbbase.py

index 18e93cf628fdac7a97b66b42b436b3813d4f3da5..2da314b49511ec2de0255ad503f82d1a0398482d 100644 (file)
@@ -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."
 
 
index 2c76a58ef5abed7f07929cc04e5338faa2a87945..09d7a52baedc5945b15af29d62747d7edfb724d4 100644 (file)
@@ -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: