projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f6f557
)
egencache: fix cmp_func for python3
author
Zac Medico
<zmedico@gentoo.org>
Fri, 18 Feb 2011 15:37:25 +0000
(07:37 -0800)
committer
Zac Medico
<zmedico@gentoo.org>
Sun, 20 Feb 2011 00:02:25 +0000
(16:02 -0800)
bin/egencache
patch
|
blob
|
history
diff --git
a/bin/egencache
b/bin/egencache
index e5685c4dc88dcdc4a0251c8f20183cc22f2d59ac..5307cd5a202d5156feff7959bfd823dab27290e6 100755
(executable)
--- 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():