Initially reported by @majosm.
With this code:
graph={1: {}, 5: {1, 8}, 8: {5}}
from pytools.graph import compute_topological_order
compute_topological_order(graph)

compute_topological_order reports:
File "/Users/mdiener/Work/emirge/pytools/pytools/graph.py", line 303, in compute_topological_order
raise CycleError(next(iter(n for n, num_preds in
pytools.graph.CycleError: 1