From 7c6494f9a13397b51e369fd111479b36c3d647d6 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Fri, 3 Apr 2020 11:07:07 -0700 Subject: [PATCH] Use decorator syntax for properties. --- dns/resolver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dns/resolver.py b/dns/resolver.py index 88930379..6e4fe0a4 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -74,7 +74,9 @@ class NXDOMAIN(dns.exception.DNSException): qnames = ', '.join(map(str, qnames)) return "{}: {}".format(msg, qnames) + @property def canonical_name(self): + """Return the unresolved canonical name.""" if not 'qnames' in self.kwargs: raise TypeError("parametrized exception required") IN = dns.rdataclass.IN @@ -89,8 +91,6 @@ class NXDOMAIN(dns.exception.DNSException): if cname is not None: return dns.name.from_text(cname) return self.kwargs['qnames'][0] - canonical_name = property(canonical_name, doc=( - "Return the unresolved canonical name.")) def __add__(self, e_nx): """Augment by results from another NXDOMAIN exception.""" -- 2.47.3