From 8fded88163b4038aed84e49da935e6a5055d3d2d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 28 Feb 2010 11:31:45 +0000 Subject: Add ObjectProxy __gt__, __ge__, __lt__, and __le__ methods to fix TypeError with python3 reported by Arfrever: File "/usr/lib/portage/pym/portage/__init__.py", line 513, in portageexit if secpass > 1 and os.environ.get("SANDBOX_ON") != "1": TypeError: unorderable types: _LazyImportFrom() > int() svn path=/main/trunk/; revision=15497 --- pym/portage/proxy/objectproxy.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pym/portage/proxy') diff --git a/pym/portage/proxy/objectproxy.py b/pym/portage/proxy/objectproxy.py index d392beb60..3e5191671 100644 --- a/pym/portage/proxy/objectproxy.py +++ b/pym/portage/proxy/objectproxy.py @@ -61,6 +61,18 @@ class ObjectProxy(object): def __hash__(self): return hash(object.__getattribute__(self, '_get_target')()) + def __ge__(self, other): + return object.__getattribute__(self, '_get_target')() >= other + + def __gt__(self, other): + return object.__getattribute__(self, '_get_target')() > other + + def __le__(self, other): + return object.__getattribute__(self, '_get_target')() <= other + + def __lt__(self, other): + return object.__getattribute__(self, '_get_target')() < other + def __eq__(self, other): return object.__getattribute__(self, '_get_target')() == other -- cgit v1.2.3-1-g7c22