aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2015-02-23 21:34:50 -0800
committerZac Medico <zmedico@gentoo.org>2015-02-24 09:40:25 -0800
commit0887d95d288226c52c1d5610b514d41a624eadb7 (patch)
treed8fbba8921a600db117b35c409a4bb1d83c9418e
parentman/portage.5: document sets.conf (bug 541188) (diff)
downloadportage-0887d95d288226c52c1d5610b514d41a624eadb7.tar.gz
portage-0887d95d288226c52c1d5610b514d41a624eadb7.tar.bz2
portage-0887d95d288226c52c1d5610b514d41a624eadb7.zip
use_reduce: support non-string token_class (bug 541198)
Do not assume that token_class returns a basestring. X-Gentoo-Bug: 541198 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=541198 Acked-by: Brian Dolbec <dolsen@gentoo.org>
-rw-r--r--pym/portage/dep/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index e2e416cf7..a8c748dba 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -558,7 +558,8 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
stack[level].extend(l)
continue
- if stack[level]:
+ if stack[level] and isinstance(stack[level][-1],
+ basestring):
if stack[level][-1] == "||" and not l:
#Optimize: || ( ) -> .
stack[level].pop()
@@ -583,7 +584,8 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
#ends in a non-operator. This is almost equivalent to stack[level][-1]=="||",
#expect that it skips empty levels.
while k>=0:
- if stack[k]:
+ if stack[k] and isinstance(stack[k][-1],
+ basestring):
if stack[k][-1] == "||":
return k
elif stack[k][-1][-1] != "?":