forked from openkylin/platform_build
Merge "releasetools: Make rangelib Python 3 compatibile." am: 1f1aafa30d
am: 207f624f75
Change-Id: Iba18162ab1c05ec780b057f1391b1f9aaf0b4039
This commit is contained in:
commit
8c9cc5fbc1
|
@ -52,9 +52,12 @@ class RangeSet(object):
|
||||||
def __ne__(self, other):
|
def __ne__(self, other):
|
||||||
return self.data != other.data
|
return self.data != other.data
|
||||||
|
|
||||||
def __nonzero__(self):
|
def __bool__(self):
|
||||||
return bool(self.data)
|
return bool(self.data)
|
||||||
|
|
||||||
|
# Python 2 uses __nonzero__, while Python 3 uses __bool__.
|
||||||
|
__nonzero__ = __bool__
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if not self.data:
|
if not self.data:
|
||||||
return "empty"
|
return "empty"
|
||||||
|
|
Loading…
Reference in New Issue