From: Brian Wellington Date: Fri, 3 Apr 2020 18:07:07 +0000 (-0700) Subject: Use decorator syntax for properties. X-Git-Tag: v2.0.0rc1~303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c6494f9a13397b51e369fd111479b36c3d647d6;p=thirdparty%2Fdnspython.git Use decorator syntax for properties. --- 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."""