From: Bob Halley Date: Thu, 12 May 2016 13:20:01 +0000 (-0700) Subject: Do not reference docstrings in exception formatting as they may be stripped. X-Git-Tag: v1.14.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3e3152dd9d1763a30642e63ec5db3ce9e4bb2fb;p=thirdparty%2Fdnspython.git Do not reference docstrings in exception formatting as they may be stripped. [issue #154] --- diff --git a/dns/exception.py b/dns/exception.py index 81c8daab..799d53ad 100644 --- a/dns/exception.py +++ b/dns/exception.py @@ -121,4 +121,4 @@ class Timeout(DNSException): """The DNS operation timed out.""" supp_kwargs = set(['timeout']) - fmt = "%s after {timeout} seconds" % __doc__[:-1] + fmt = "The DNS operation timed out after {timeout} seconds" diff --git a/dns/resolver.py b/dns/resolver.py index e00a7ca4..92414440 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -80,7 +80,8 @@ Timeout = dns.exception.Timeout class NoAnswer(dns.exception.DNSException): """The DNS response does not contain an answer to the question.""" - fmt = '%s: {query}' % __doc__[:-1] + fmt = 'The DNS response does not contain an answer ' + \ + 'to the question: {query}' supp_kwargs = set(['response']) def _fmt_kwargs(self, **kwargs):