get_dep_chain: handle InvalidDependString
authorZac Medico <zmedico@gentoo.org>
Thu, 24 Mar 2011 04:08:35 +0000 (21:08 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 26 Mar 2011 19:20:35 +0000 (12:20 -0700)
pym/_emerge/depgraph.py

index f17a93ccbd0045a407a1b4e02e2120dab7a490af..91ec7599e17c3255be5c218f5b8f994e28b2ccb0 100644 (file)
@@ -2308,8 +2308,12 @@ class depgraph(object):
                if target_atom is not None and isinstance(node, Package):
                        affecting_use = set()
                        for dep_str in "DEPEND", "RDEPEND", "PDEPEND":
-                               affecting_use.update(extract_affecting_use(
-                                       node.metadata[dep_str], target_atom))
+                               try:
+                                       affecting_use.update(extract_affecting_use(
+                                               node.metadata[dep_str], target_atom))
+                               except InvalidDependString:
+                                       if not node.installed:
+                                               raise
                        affecting_use.difference_update(node.use.mask, node.use.force)
                        pkg_name = _unicode_decode("%s") % (node.cpv,)
                        if affecting_use: