sim: generators are also iterables...
authorSebastien Bourdeauducq <sb@m-labs.hk>
Mon, 19 Oct 2015 11:21:20 +0000 (19:21 +0800)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Mon, 19 Oct 2015 11:21:20 +0000 (19:21 +0800)
migen/sim/core.py

index b036dbe2c70bf933e7b3a6baca010412a189ee42..8ad6991362d89588704f581d1ad2429faea80bb5 100644 (file)
@@ -211,7 +211,8 @@ class Simulator:
             generators = {"sys": generators}
         self.generators = dict()
         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)
             else:
                 self.generators[k] = [v]