Merge "releasetools: Make rangelib Python 3 compatibile."

am: 1f1aafa30d

Change-Id: I92b2e47669d0b8e4bfa089354102efeb106a8a16
This commit is contained in:
Tao Bao 2019-06-20 18:07:45 -07:00 committed by android-build-merger
commit 207f624f75
1 changed files with 4 additions and 1 deletions

View File

@ -52,9 +52,12 @@ class RangeSet(object):
def __ne__(self, other):
return self.data != other.data
def __nonzero__(self):
def __bool__(self):
return bool(self.data)
# Python 2 uses __nonzero__, while Python 3 uses __bool__.
__nonzero__ = __bool__
def __str__(self):
if not self.data:
return "empty"