From de59d697d76e786e31d12e32f3fefa2e8d8a3e7e Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 2 Mar 2010 21:09:52 +0000 Subject: [PATCH] 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() (trunk r15497) svn path=/main/branches/2.1.7/; revision=15698 --- 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 -- 2.26.2