diff options
Diffstat (limited to 'pym/portage/proxy/objectproxy.py')
-rw-r--r-- | pym/portage/proxy/objectproxy.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/portage/proxy/objectproxy.py b/pym/portage/proxy/objectproxy.py index 6dffff7d5..dff4a07f7 100644 --- a/pym/portage/proxy/objectproxy.py +++ b/pym/portage/proxy/objectproxy.py @@ -2,6 +2,8 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ +import sys + __all__ = ['ObjectProxy'] class ObjectProxy(object): @@ -70,8 +72,11 @@ 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')()) |