sim: generators are also iterables...

This commit is contained in:
Sebastien Bourdeauducq 2015-10-19 19:21:20 +08:00
parent 02d804feab
commit 1f89900b16
1 changed files with 2 additions and 1 deletions

View File

@ -211,7 +211,8 @@ class Simulator:
generators = {"sys": generators} generators = {"sys": generators}
self.generators = dict() self.generators = dict()
for k, v in generators.items(): for k, v in generators.items():
if isinstance(v, collections.Iterable): if (isinstance(v, collections.Iterable)
and not isinstance(v, collections.Generator)):
self.generators[k] = list(v) self.generators[k] = list(v)
else: else:
self.generators[k] = [v] self.generators[k] = [v]