Skip to content

Commit

Permalink
Merge pull request #20 from StyleShare/fix-totaltime
Browse files Browse the repository at this point in the history
Fix an error raised when some node data are empty.
  • Loading branch information
amcfague committed Jan 18, 2012
2 parents 7637864 + 7574c90 commit a01c32c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions linesman/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ def prepare_graph(source_graph, cutoff_time, break_cycles=False):
# Always use a copy for destructive changes
graph = source_graph.copy()

# Some node data could be empty dict
for node, data in graph.nodes(data=True):
if not data:
data['totaltime'] = 0

max_totaltime = max(data['totaltime']
for node, data in graph.nodes(data=True))
for node, data in graph.nodes(data=True):
Expand Down

0 comments on commit a01c32c

Please sign in to comment.