From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id F403E138A87 for ; Tue, 24 Feb 2015 17:41:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7932DE084E; Tue, 24 Feb 2015 17:41:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 27D36E084E for ; Tue, 24 Feb 2015 17:41:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3615D33FB4A for ; Tue, 24 Feb 2015 17:41:17 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DA2591276B for ; Tue, 24 Feb 2015 17:41:15 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1424799625.0887d95d288226c52c1d5610b514d41a624eadb7.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dep/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dep/__init__.py X-VCS-Directories: pym/portage/dep/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 0887d95d288226c52c1d5610b514d41a624eadb7 X-VCS-Branch: master Date: Tue, 24 Feb 2015 17:41:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 44c906a0-fe93-4617-b4f1-860c39f70366 X-Archives-Hash: 7c0b8d0ba1da9f1c2ce2defe19dbd487 commit: 0887d95d288226c52c1d5610b514d41a624eadb7 Author: Zac Medico gentoo org> AuthorDate: Tue Feb 24 05:34:50 2015 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Feb 24 17:40:25 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0887d95d 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 gentoo.org> --- pym/portage/dep/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index e2e416c..a8c748d 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] != "?":