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/__init__.py | 2 +- pym/portage/proxy/objectproxy.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 9d0f929b2..213d4ebb5 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -510,7 +510,7 @@ auxdbkeys = ( auxdbkeylen=len(auxdbkeys) def portageexit(): - if secpass > 1 and os.environ.get("SANDBOX_ON") != "1": + if data.secpass > 1 and os.environ.get("SANDBOX_ON") != "1": close_portdbapi_caches() try: mtimedb 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