From 72fb6fd6bd6707a5044b0c7f723aedfef87b66df Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 9 Mar 2013 23:03:15 +0100 Subject: [PATCH] fhdl/tools/flat_iteration: generalize --- migen/fhdl/tools.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migen/fhdl/tools.py b/migen/fhdl/tools.py index f9cb67c7..f7b50fd7 100644 --- a/migen/fhdl/tools.py +++ b/migen/fhdl/tools.py @@ -1,10 +1,12 @@ +import collections + from migen.fhdl.structure import * from migen.fhdl.structure import _Operator, _Slice, _Assign, _ArrayProxy from migen.fhdl.visit import NodeVisitor, NodeTransformer def flat_iteration(l): for element in l: - if isinstance(element, (list, tuple)): + if isinstance(element, collections.Iterable): for element2 in flat_iteration(element): yield element2 else: -- 2.30.2