From: Zac Medico Date: Sat, 24 May 2008 21:00:07 +0000 (-0000) Subject: Fix use_reduce() so that it appropriately raises an InvalidDependString X-Git-Tag: v2.2_pre8~123 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7502324ea6d85f96b251973014684cba5251d973;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). svn path=/main/trunk/; revision=10391 --- diff --git a/pym/portage/dep.py b/pym/portage/dep.py index 267b356fb..998abfee7 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -230,7 +230,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] == "?":