From: Marius Mauch Date: Tue, 13 May 2008 19:36:33 +0000 (-0000) Subject: Check vercmp() return value to avoid arbitrary results in case it returns None X-Git-Tag: v2.2_pre7~27 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=284000fb7a11b6b58d4908ba180dc32152598b05;p=portage.git Check vercmp() return value to avoid arbitrary results in case it returns None svn path=/main/trunk/; revision=10322 --- diff --git a/pym/portage/versions.py b/pym/portage/versions.py index 115064578..4a12ef9d5 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