From: Zac Medico Date: Sat, 24 May 2008 21:33:12 +0000 (-0000) Subject: Fix paren_reduce() so that it appropriately raises an InvalidDependString() X-Git-Tag: v2.2_pre8~121 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=22570f366563067cb6fafc683500dc8f57bf5e4d;p=portage.git Fix paren_reduce() so that it appropriately raises an InvalidDependString() in some cases, instead of a nonsense ValueError. svn path=/main/trunk/; revision=10393 --- diff --git a/pym/portage/dep.py b/pym/portage/dep.py index 5f858849b..fa87a7719 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -108,7 +108,11 @@ def paren_reduce(mystr,tokenize=1): "missing right parenthesis: '%s'" % mystr) elif has_left_paren and left_paren < right_paren: freesec,subsec = mystr.split("(",1) - subsec,tail = paren_reduce(subsec,tokenize) + sublist = paren_reduce(subsec, tokenize=tokenize) + if len(sublist) != 2: + raise portage.exception.InvalidDependString( + "malformed syntax: '%s'" % mystr) + subsec, tail = sublist else: subsec,tail = mystr.split(")",1) if tokenize: