From: Zac Medico Date: Tue, 13 May 2008 20:05:14 +0000 (-0000) Subject: Check vercmp() return value to avoid arbitrary results in case it returns None X-Git-Tag: v2.1.5~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=19faec9972e5ac014f302a999fa4391155a6face;p=portage.git Check vercmp() return value to avoid arbitrary results in case it returns None (trunk r10322) svn path=/main/branches/2.1.2/; revision=10323 --- diff --git a/pym/portage_versions.py b/pym/portage_versions.py index 6cf7a1998..ff31fbd4e 100644 --- a/pym/portage_versions.py +++ b/pym/portage_versions.py @@ -190,9 +190,11 @@ def pkgcmp(pkg1, pkg2): if pkg1[0] != pkg2[0]: return None mycmp = vercmp("-".join(pkg1[1:]), "-".join(pkg2[1:])) - if mycmp>0: + if mycmp is None: + return mycmp + if mycmp > 0: return 1 - if mycmp<0: + if mycmp < 0: return -1 return 0