Fix get_cycles() to handle None return value from shortest_path().
authorZac Medico <zmedico@gentoo.org>
Wed, 18 Aug 2010 20:49:52 +0000 (13:49 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 18 Aug 2010 20:49:52 +0000 (13:49 -0700)
pym/portage/util/digraph.py

index 97f9c99b24cdc12f3f20a279516c15746c2e2a3c..2849b8e2c4027a1ba180f19ada13e1be110bfac0 100644 (file)
@@ -310,6 +310,8 @@ class digraph(object):
                        shortest_path = None
                        for child in self.child_nodes(node, ignore_priority):
                                path = self.shortest_path(child, node, ignore_priority)
+                               if path is None:
+                                       continue
                                if not shortest_path or len(shortest_path) > len(path):
                                        shortest_path = path
                        if shortest_path: