]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Reduce the number of digits after the decimal point for the Timeout DNSException...
authorCraig Leres <leres@xse.com>
Sun, 30 Jan 2022 18:40:54 +0000 (10:40 -0800)
committerGitHub <noreply@github.com>
Sun, 30 Jan 2022 18:40:54 +0000 (10:40 -0800)
* Reduce the number of digits after the decimal point for the Timeout
DNSException from 15 to 1

* Address Bob Halley's concerns: change .1f to .3f and update LifetimeTimeout

dns/exception.py
dns/resolver.py

index 9392373492e05f86d43c190dec5d37231276b6ce..0839382158c2e47f583e0294db4cfc300791708c 100644 (file)
@@ -125,7 +125,7 @@ class TooBig(DNSException):
 class Timeout(DNSException):
     """The DNS operation timed out."""
     supp_kwargs = {'timeout'}
-    fmt = "The DNS operation timed out after {timeout} seconds"
+    fmt = "The DNS operation timed out after {timeout:.3f} seconds"
 
 
 class ExceptionWrapper:
index d3917141cb9a19ebc1cdf7fb7810c0a51b88af0d..5dc2761a4336bee62991b606bc453f410845e8ec 100644 (file)
@@ -145,7 +145,7 @@ class LifetimeTimeout(dns.exception.Timeout):
     """The resolution lifetime expired."""
 
     msg = "The resolution lifetime expired."
-    fmt = "%s after {timeout} seconds: {errors}" % msg[:-1]
+    fmt = "%s after {timeout:.3f} seconds: {errors}" % msg[:-1]
     supp_kwargs = {'timeout', 'errors'}
 
     def _fmt_kwargs(self, **kwargs):