Merge pull request #635 from Xiretza/collections-abc-deprecation

Fix DeprecationWarning for collections.abc
This commit is contained in:
enjoy-digital 2020-08-22 19:40:44 +02:00 committed by GitHub
commit 8bc5dd7c8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -143,7 +143,7 @@ def _printnode(ns, at, level, node, target_filter=None):
else:
assignment = " <= "
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)
elif isinstance(node, If):
r = "\t"*level + "if (" + _printexpr(ns, node.cond)[0] + ") begin\n"

View File

@ -223,7 +223,7 @@ class Evaluator:
break
if not found and "default" in s.cases:
self.execute(s.cases["default"])
elif isinstance(s, collections.Iterable):
elif isinstance(s, collections.abc.Iterable):
self.execute(s)
elif isinstance(s, Display):
args = []
@ -275,7 +275,7 @@ class Simulator:
self.generators = dict()
self.passive_generators = set()
for k, v in generators.items():
if (isinstance(v, collections.Iterable)
if (isinstance(v, collections.abc.Iterable)
and not inspect.isgenerator(v)):
self.generators[k] = list(v)
else: