Merge pull request #635 from Xiretza/collections-abc-deprecation
Fix DeprecationWarning for collections.abc
This commit is contained in:
commit
8bc5dd7c8c
|
@ -143,7 +143,7 @@ def _printnode(ns, at, level, node, target_filter=None):
|
||||||
else:
|
else:
|
||||||
assignment = " <= "
|
assignment = " <= "
|
||||||
return "\t"*level + _printexpr(ns, node.l)[0] + assignment + _printexpr(ns, node.r)[0] + ";\n"
|
return "\t"*level + _printexpr(ns, node.l)[0] + assignment + _printexpr(ns, node.r)[0] + ";\n"
|
||||||
elif isinstance(node, collections.Iterable):
|
elif isinstance(node, collections.abc.Iterable):
|
||||||
return "".join(_printnode(ns, at, level, n, target_filter) for n in node)
|
return "".join(_printnode(ns, at, level, n, target_filter) for n in node)
|
||||||
elif isinstance(node, If):
|
elif isinstance(node, If):
|
||||||
r = "\t"*level + "if (" + _printexpr(ns, node.cond)[0] + ") begin\n"
|
r = "\t"*level + "if (" + _printexpr(ns, node.cond)[0] + ") begin\n"
|
||||||
|
|
|
@ -223,7 +223,7 @@ class Evaluator:
|
||||||
break
|
break
|
||||||
if not found and "default" in s.cases:
|
if not found and "default" in s.cases:
|
||||||
self.execute(s.cases["default"])
|
self.execute(s.cases["default"])
|
||||||
elif isinstance(s, collections.Iterable):
|
elif isinstance(s, collections.abc.Iterable):
|
||||||
self.execute(s)
|
self.execute(s)
|
||||||
elif isinstance(s, Display):
|
elif isinstance(s, Display):
|
||||||
args = []
|
args = []
|
||||||
|
@ -275,7 +275,7 @@ class Simulator:
|
||||||
self.generators = dict()
|
self.generators = dict()
|
||||||
self.passive_generators = set()
|
self.passive_generators = set()
|
||||||
for k, v in generators.items():
|
for k, v in generators.items():
|
||||||
if (isinstance(v, collections.Iterable)
|
if (isinstance(v, collections.abc.Iterable)
|
||||||
and not inspect.isgenerator(v)):
|
and not inspect.isgenerator(v)):
|
||||||
self.generators[k] = list(v)
|
self.generators[k] = list(v)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue