From 22570f366563067cb6fafc683500dc8f57bf5e4d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 24 May 2008 21:33:12 +0000 Subject: [PATCH] Fix paren_reduce() so that it appropriately raises an InvalidDependString() in some cases, instead of a nonsense ValueError. svn path=/main/trunk/; revision=10393 --- pym/portage/dep.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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: -- 2.26.2