Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f1aafa3 authored by Tao Bao's avatar Tao Bao Committed by Gerrit Code Review
Browse files

Merge "releasetools: Make rangelib Python 3 compatibile."

parents fde688eb d660c8d8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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"