diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-02-18 07:37:25 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-02-18 07:37:25 -0800 |
commit | 98e11ed423ef33e433573fea51a941bc9e2f9d0d (patch) | |
tree | b06397f2c467496faf0659447ee65c77483256c8 | |
parent | 7867f86893b6f2c94f8e696428e1d4ab92923fd6 (diff) | |
download | portage-98e11ed423ef33e433573fea51a941bc9e2f9d0d.tar.gz portage-98e11ed423ef33e433573fea51a941bc9e2f9d0d.tar.bz2 portage-98e11ed423ef33e433573fea51a941bc9e2f9d0d.zip |
egencache: fix cmp_func for python3
-rwxr-xr-x | bin/egencache | 8 |
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(): |