From: Zac Medico Date: Sun, 25 May 2008 04:19:38 +0000 (-0000) Subject: Fix use_reduce() so that it appropriately raises an InvalidDependString X-Git-Tag: v2.1.5.3~56 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5e39470e1d14bf9cca26bc955354f409ddd8b2d4;p=portage.git 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 --- 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] == "?":