From 776579f0d7d029a545134e023d8a8b68f8b27815 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 17 Sep 2015 17:22:24 +0800 Subject: [PATCH] fhdl/structure: all case statements should be lists --- migen/fhdl/structure.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index e3faae51d..ba72f09b0 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -547,6 +547,8 @@ class Case(_Statement): if (not isinstance(k, Constant) and not (isinstance(k, str) and k == "default")): raise TypeError("Case object is not a Migen constant") + if not isinstance(v, _collections.Iterable): + v = [v] if not _check_statement(v): raise TypeError("Not all objects for case {} " "are Migen statements".format(k))