diff options
Diffstat (limited to 'generator')
-rw-r--r-- | generator/nanopb_generator.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py index 67c422d9..22331f0d 100644 --- a/generator/nanopb_generator.py +++ b/generator/nanopb_generator.py @@ -327,15 +327,15 @@ def toposort2(data): for k, v in data.items(): v.discard(k) # Ignore self dependencies extra_items_in_deps = reduce(set.union, data.values()) - set(data.keys()) - data.update({item:set() for item in extra_items_in_deps}) + data.update(dict([(item, set()) for item in extra_items_in_deps])) while True: ordered = set(item for item,dep in data.items() if not dep) if not ordered: break for item in sorted(ordered): yield item - data = {item: (dep - ordered) for item,dep in data.items() - if item not in ordered} + data = dict([(item, (dep - ordered)) for item,dep in data.items() + if item not in ordered]) assert not data, "A cyclic dependency exists amongst %r" % data def sort_dependencies(messages): @@ -426,4 +426,4 @@ if __name__ == '__main__': for part in generate_source(headerbasename, enums, messages): source.write(part) -
\ No newline at end of file + |