Fix paren_reduce() so that it appropriately raises an InvalidDependString()
authorZac Medico <zmedico@gentoo.org>
Sun, 25 May 2008 04:21:33 +0000 (04:21 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 25 May 2008 04:21:33 +0000 (04:21 -0000)
in some cases, instead of a nonsense AttributeError. (trunk r10392)

svn path=/main/branches/2.1.2/; revision=10408

pym/portage_dep.py

index 4fb6ddde9c5a681c1012d71dba0524995566d59c..9ad8421c9bae36157c28c438c452937337231138 100644 (file)
@@ -96,6 +96,9 @@ def paren_reduce(mystr,tokenize=1):
                                subsec = strip_empty(subsec.split(" "))
                                return [mylist+subsec,tail]
                        return mylist+[subsec],tail
+               if not isinstance(tail, basestring):
+                       raise portage_exception.InvalidDependString(
+                               "malformed syntax: '%s'" % mystr)
                mystr = tail
                if freesec:
                        if tokenize: