mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
dnsutil: Rename __nonzero__ to __bool__
In Python 3, this special method got renamed. Set both to the same function to keep compatibility. https://fedorahosted.org/freeipa/ticket/5623 Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
06a678c159
commit
983c53bb6c
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user