From: Zac Medico Date: Wed, 11 Mar 2009 06:43:02 +0000 (-0000) Subject: Use enumerate() inside use_reduce() validation code. (trunk r12758) X-Git-Tag: v2.1.6.8~71 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1176ae57d903feb5e8d39bcf8e33f640d419832f;p=portage.git Use enumerate() inside use_reduce() validation code. (trunk r12758) svn path=/main/branches/2.1.6/; revision=13006 --- diff --git a/pym/portage/dep.py b/pym/portage/dep.py index 48465ddbe..0bff1104c 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -216,8 +216,8 @@ def use_reduce(deparray, uselist=[], masklist=[], matchall=0, excludeall=[]): @return: The use reduced depend array """ # Quick validity checks - for x in range(len(deparray)): - if deparray[x] in ["||","&&"]: + for x, y in enumerate(deparray): + if y == '||': if len(deparray) - 1 == x or not isinstance(deparray[x+1], list): raise portage.exception.InvalidDependString(deparray[x]+" missing atom list in \""+paren_enclose(deparray)+"\"") if deparray and deparray[-1] and deparray[-1][-1] == "?":