diff --git a/ipapython/dnsutil.py b/ipapython/dnsutil.py index a11d744d7..18141fa09 100644 --- a/ipapython/dnsutil.py +++ b/ipapython/dnsutil.py @@ -49,11 +49,13 @@ class DNSName(dns.name.Name): # instead of a dns.exception raise dns.exception.SyntaxError(e) - def __nonzero__(self): + def __bool__(self): #dns.name.from_text('@') is represented like empty tuple #we need to acting '@' as nonzero value return True + __nonzero__ = __bool__ # for Python 2 + def __copy__(self): return DNSName(self.labels)