From 7615edbbca3eeb91954fa78f7f314d6bb12af603 Mon Sep 17 00:00:00 2001 From: lxnay Date: Tue, 17 Mar 2009 22:46:45 +0000 Subject: [PATCH] Entropy/tools: - fix regression on result returned from compare_versions git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@3202 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- libraries/entropy/tools.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/entropy/tools.py b/libraries/entropy/tools.py index e7ed43f9c..017768290 100644 --- a/libraries/entropy/tools.py +++ b/libraries/entropy/tools.py @@ -1470,15 +1470,18 @@ def compare_versions(ver1, ver2): # checking that the versions are valid invalid = False + invalid_rc = 0 if not match1: invalid = True elif not match1.groups(): invalid = True elif not match2: + invalid_rc = 1 invalid = True elif not match2.groups(): + invalid_rc = 1 invalid = True - if invalid: return None + if invalid: return invalid_rc # building lists of the version parts before the suffix # first part is simple