From be7dad49220f61f33c4b51daec13ffeef515798c Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Tue, 21 Jul 2020 11:23:54 -0700 Subject: [PATCH] fix exception docstrings --- dns/message.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/dns/message.py b/dns/message.py index fd9ddb50..29fca22b 100644 --- a/dns/message.py +++ b/dns/message.py @@ -716,19 +716,21 @@ class QueryMessage(Message): """Follow the CNAME chain in the response to determine the answer RRset. - Raises NotQueryResponse if the message is not a response. + Raises ``dns.message.NotQueryResponse`` if the message is not + a response. - Raises dns.message.ChainTooLong if the CNAME chain is too long. + Raises ``dns.message.ChainTooLong`` if the CNAME chain is too long. - Raises AnswerForNXDOMAIN if the rcode is NXDOMAIN but an answer was - found. + Raises ``dns.message.AnswerForNXDOMAIN`` if the rcode is NXDOMAIN + but an answer was found. - Raises dns.exception.FormError if the question count is not 1. + Raises ``dns.exception.FormError`` if the question count is not 1. Returns a tuple (dns.name.Name, int, rrset) where the name is the canonical name, the int is the minimized TTL, and rrset is their answer RRset, which may be ``None`` if the chain was dangling or the response is an NXDOMAIN. + """ if self.flags & dns.flags.QR == 0: raise NotQueryResponse @@ -792,14 +794,15 @@ class QueryMessage(Message): """Return the canonical name of the first name in the question section. - Raises dns.message.NotQueryResponse if the message is not a response. + Raises ``dns.message.NotQueryResponse`` if the message is not + a response. - Raises dns.message.ChainTooLong if the CNAME chain is too long. + Raises ``dns.message.ChainTooLong`` if the CNAME chain is too long. - Raises AnswerForNXDOMAIN if the rcode is NXDOMAIN but an answer was - found. + Raises ``dns.message.AnswerForNXDOMAIN`` if the rcode is NXDOMAIN + but an answer was found. - Raises dns.exception.FormError if the question count is not 1. + Raises ``dns.exception.FormError`` if the question count is not 1. """ return self.resolve_chaining()[0] -- 2.47.3