Fix paren_reduce() so that it appropriately raises an InvalidDependString()
authorZac Medico <zmedico@gentoo.org>
Sat, 24 May 2008 21:23:39 +0000 (21:23 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 24 May 2008 21:23:39 +0000 (21:23 -0000)
in some cases, instead of a nonsense AttributeError.

svn path=/main/trunk/; revision=10392

pym/portage/dep.py

index 998abfee71afeb882732077c34d8f46fbb25b8f3..5f858849b980b48c4810bc67e26c3d9e7eba64dd 100644 (file)
@@ -115,6 +115,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: