No bug: [taskgraph] Improve the error message in Graph.transitive_closure; r=mhentges

Differential Revision: https://phabricator.services.mozilla.com/D48000

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tom Prince 2019-10-03 01:27:02 +00:00
Родитель 5af8c9966d
Коммит ecba850f66
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -50,7 +50,8 @@ class Graph(object):
transitive_closure([b], reverse=True).nodes == set([b, c, d])
"""
assert isinstance(nodes, set)
assert nodes <= self.nodes
if not (nodes <= self.nodes):
raise Exception("Unknown nodes in transitive closure: {}".format(nodes - self.nodes))
# generate a new graph by expanding along edges until reaching a fixed
# point