sim: do not use py35 collections.Generator

This commit is contained in:
Sebastien Bourdeauducq 2015-10-20 16:37:54 +08:00
parent 02e2366015
commit 60ae9dce0d
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import operator import operator
import collections import collections
import inspect
from migen.fhdl.structure import * from migen.fhdl.structure import *
from migen.fhdl.structure import (_Value, _Statement, from migen.fhdl.structure import (_Value, _Statement,
@ -219,7 +220,7 @@ class Simulator:
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)): and not inspect.isgenerator(v)):
self.generators[k] = list(v) self.generators[k] = list(v)
else: else:
self.generators[k] = [v] self.generators[k] = [v]