Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r15497 - in main/trunk/pym/portage: . proxy
Date: Sun, 28 Feb 2010 11:31:55
Message-Id: E1NlhNB-0006oA-I7@stork.gentoo.org
1 Author: zmedico
2 Date: 2010-02-28 11:31:45 +0000 (Sun, 28 Feb 2010)
3 New Revision: 15497
4
5 Modified:
6 main/trunk/pym/portage/__init__.py
7 main/trunk/pym/portage/proxy/objectproxy.py
8 Log:
9 Add ObjectProxy __gt__, __ge__, __lt__, and __le__ methods to fix TypeError
10 with python3 reported by Arfrever:
11
12 File "/usr/lib/portage/pym/portage/__init__.py", line 513, in portageexit
13 if secpass > 1 and os.environ.get("SANDBOX_ON") != "1":
14 TypeError: unorderable types: _LazyImportFrom() > int()
15
16
17 Modified: main/trunk/pym/portage/__init__.py
18 ===================================================================
19 --- main/trunk/pym/portage/__init__.py 2010-02-28 10:49:02 UTC (rev 15496)
20 +++ main/trunk/pym/portage/__init__.py 2010-02-28 11:31:45 UTC (rev 15497)
21 @@ -510,7 +510,7 @@
22 auxdbkeylen=len(auxdbkeys)
23
24 def portageexit():
25 - if secpass > 1 and os.environ.get("SANDBOX_ON") != "1":
26 + if data.secpass > 1 and os.environ.get("SANDBOX_ON") != "1":
27 close_portdbapi_caches()
28 try:
29 mtimedb
30
31 Modified: main/trunk/pym/portage/proxy/objectproxy.py
32 ===================================================================
33 --- main/trunk/pym/portage/proxy/objectproxy.py 2010-02-28 10:49:02 UTC (rev 15496)
34 +++ main/trunk/pym/portage/proxy/objectproxy.py 2010-02-28 11:31:45 UTC (rev 15497)
35 @@ -61,6 +61,18 @@
36 def __hash__(self):
37 return hash(object.__getattribute__(self, '_get_target')())
38
39 + def __ge__(self, other):
40 + return object.__getattribute__(self, '_get_target')() >= other
41 +
42 + def __gt__(self, other):
43 + return object.__getattribute__(self, '_get_target')() > other
44 +
45 + def __le__(self, other):
46 + return object.__getattribute__(self, '_get_target')() <= other
47 +
48 + def __lt__(self, other):
49 + return object.__getattribute__(self, '_get_target')() < other
50 +
51 def __eq__(self, other):
52 return object.__getattribute__(self, '_get_target')() == other