Python 3: set __bool__() method on Namespace
The Python 2 __nonzero__() method was renamed to __bool__() in Python 3. Create a __bool__ alias to __nonzero__ in the Namespace class. Change-Id: I2ad3b3522b9ee2d33a5eee8886ee5f07776fb449
This commit is contained in:
parent
253a6288e8
commit
a6b0ca69ce
@ -89,3 +89,4 @@ class Namespace(object):
|
||||
|
||||
def __nonzero__(self):
|
||||
return len(self.__dict__) > 0
|
||||
__bool__ = __nonzero__
|
||||
|
Loading…
x
Reference in New Issue
Block a user