# Distributed under the terms of the GNU General Public License v2
# $Id$
+import sys
from _emerge.SlotObject import SlotObject
from collections import deque
class SequentialTaskQueue(SlotObject):
task.cancel()
self._dirty = False
- def __nonzero__(self):
+ def __bool__(self):
return bool(self._task_queue or self.running_tasks)
+ if sys.hexversion < 0x3000000:
+ __nonzero__ = __bool__
+
def __len__(self):
return len(self._task_queue) + len(self.running_tasks)
-
raise InvalidAtom(_("Invalid use dep: '%s'") % (token,))
return flag
- def __nonzero__(self):
+ def __bool__(self):
return bool(self.tokens)
+ if sys.hexversion < 0x3000000:
+ __nonzero__ = __bool__
+
def __str__(self):
if not self.tokens:
return ""
# Distributed under the terms of the GNU General Public License v2
# $Id$
+import sys
+
__all__ = ['ObjectProxy']
class ObjectProxy(object):
def __ne__(self, other):
return object.__getattribute__(self, '_get_target')() != other
- def __nonzero__(self):
+ def __bool__(self):
return bool(object.__getattribute__(self, '_get_target')())
+ if sys.hexversion < 0x3000000:
+ __nonzero__ = __bool__
+
def __int__(self):
return int(object.__getattribute__(self, '_get_target')())
for x in self._nonatoms:
yield x
- def __nonzero__(self):
+ def __bool__(self):
self._load()
return bool(self._atoms or self._nonatoms)
+ if sys.hexversion < 0x3000000:
+ __nonzero__ = __bool__
+
def supportsOperation(self, op):
if not op in OPERATIONS:
raise ValueError(op)