summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-01-12 03:38:36 +0000
committerAlec Warner <antarus@gentoo.org>2007-01-12 03:38:36 +0000
commit90a5908947db58d3fbafd7e1e44e3d56815526f6 (patch)
tree4f49ad67142d1f8e3ab7000bd1f10dad6d2fbf4d
parentb10afa45d5cf97d47fc2e7bf7c7939996b83cb94 (diff)
downloadportage-90a5908947db58d3fbafd7e1e44e3d56815526f6.tar.gz
portage-90a5908947db58d3fbafd7e1e44e3d56815526f6.tar.bz2
portage-90a5908947db58d3fbafd7e1e44e3d56815526f6.zip
Change vercmp to use int() instead of string atoi, catch ValueError in pkgcmp
svn path=/main/trunk/; revision=5581
-rw-r--r--pym/portage_dep.py4
-rw-r--r--pym/portage_versions.py6
2 files changed, 4 insertions, 6 deletions
diff --git a/pym/portage_dep.py b/pym/portage_dep.py
index 56c923886..271c5ef04 100644
--- a/pym/portage_dep.py
+++ b/pym/portage_dep.py
@@ -618,9 +618,7 @@ def match_from_list(mydep, candidate_list):
for x in candidate_list:
try:
result = pkgcmp(pkgsplit(x), mysplit)
- except SystemExit:
- raise
- except:
+ except ValueError:
writemsg("\nInvalid package name: %s\n" % x, noiselevel=-1)
raise
if result is None:
diff --git a/pym/portage_versions.py b/pym/portage_versions.py
index b80e3739e..1a9fdd054 100644
--- a/pym/portage_versions.py
+++ b/pym/portage_versions.py
@@ -75,9 +75,9 @@ def vercmp(ver1, ver2, silent=1):
# building lists of the version parts before the suffix
# first part is simple
- list1 = [string.atoi(match1.group(2))]
- list2 = [string.atoi(match2.group(2))]
-
+ list1 = [int(match1.group(2))]
+ list2 = [int(match2.group(2))]
+
# this part would greatly benefit from a fixed-length version pattern
if len(match1.group(3)) or len(match2.group(3)):
vlist1 = match1.group(3)[1:].split(".")