From 5e39470e1d14bf9cca26bc955354f409ddd8b2d4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 25 May 2008 04:19:38 +0000 Subject: Fix use_reduce() so that it appropriately raises an InvalidDependString instead of an IndexError in some cases (avoid IndexError by using slice notation). (trunk r10391) svn path=/main/branches/2.1.2/; revision=10407 --- pym/portage_dep.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pym/portage_dep.py b/pym/portage_dep.py index 26737d618..4fb6ddde9 100644 --- a/pym/portage_dep.py +++ b/pym/portage_dep.py @@ -175,7 +175,7 @@ def use_reduce(deparray, uselist=[], masklist=[], matchall=0, excludeall=[]): rlist.append([]) else: - if head[-1] == "?": # Use reduce next group on fail. + if head[-1:] == "?": # Use reduce next group on fail. # Pull any other use conditions and the following atom or list into a separate array newdeparray = [head] while isinstance(newdeparray[-1], str) and newdeparray[-1][-1] == "?": -- cgit v1.2.3-1-g7c22