summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-02-18 07:37:25 -0800
committerZac Medico <zmedico@gentoo.org>2011-02-19 16:02:25 -0800
commit7ef8b7dd49d103a6545d70a39398a56c2dbe138b (patch)
tree961f5296088e1a1993da3e5c0717dabad7a1571b /bin
parent4f6f5579be8e647702163e9fcc9f146b2ed4a444 (diff)
downloadportage-7ef8b7dd49d103a6545d70a39398a56c2dbe138b.tar.gz
portage-7ef8b7dd49d103a6545d70a39398a56c2dbe138b.tar.bz2
portage-7ef8b7dd49d103a6545d70a39398a56c2dbe138b.zip
egencache: fix cmp_func for python3
Diffstat (limited to 'bin')
-rwxr-xr-xbin/egencache8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/egencache b/bin/egencache
index e5685c4dc..5307cd5a2 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -455,6 +455,14 @@ class GenUseLocalDesc(object):
# since we don't want any confusion given that we never
# want to rely on the builtin cmp function.
def cmp_func(a, b):
+ if a is None or b is None:
+ # None can't be compared with other types in python3.
+ if a is None and b is None:
+ return 0
+ elif a is None:
+ return -1
+ else:
+ return 1
return (a > b) - (a < b)
for cp in self._portdb.cp_all():