]> 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)
committerBob Halley <halley@play-bow.org>
Sun, 30 Jan 2022 18:41:49 +0000 (10:41 -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

(cherry picked from commit 1f636810325144cd6aaeae8f673de230615ff186)

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 874221d1d6100d84a2bbff9ad39055d3e4887ab5..ef2a6d5c774ee71a13564dd8372b1d1a7ea9fa46 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):