sim: do not use py35 collections.Generator
authorSebastien Bourdeauducq <sb@m-labs.hk>
Tue, 20 Oct 2015 08:37:54 +0000 (16:37 +0800)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Tue, 20 Oct 2015 08:37:54 +0000 (16:37 +0800)
migen/sim/core.py

index fa571ff38698ecc7e117992bb29f74a095c9705a..fc750833c0c848830e3a893cc2d5ed743167c652 100644 (file)
@@ -1,5 +1,6 @@
 import operator
 import collections
+import inspect
 
 from migen.fhdl.structure import *
 from migen.fhdl.structure import (_Value, _Statement,
@@ -219,7 +220,7 @@ class Simulator:
         self.generators = dict()
         for k, v in generators.items():
             if (isinstance(v, collections.Iterable)
-                    and not isinstance(v, collections.Generator)):
+                    and not inspect.isgenerator(v)):
                 self.generators[k] = list(v)
             else:
                 self.generators[k] = [v]