From 193fd7a393da9b57e652c3fa1b4032d82d4d4eab Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 13 Jun 2019 03:54:46 +0000 Subject: [PATCH] compat.fhdl.structure: fix Case().makedefault(). Fixes #100. --- nmigen/compat/fhdl/structure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmigen/compat/fhdl/structure.py b/nmigen/compat/fhdl/structure.py index a36086e..0a58d74 100644 --- a/nmigen/compat/fhdl/structure.py +++ b/nmigen/compat/fhdl/structure.py @@ -105,7 +105,7 @@ class Case(ast.Switch): or (isinstance(choice, str) and choice == "default") or choice > key): key = choice - if isinstance(key, str) and key == "default": + elif isinstance(key, str) and key == "default": key = "-" * len(self.test) else: key = "{:0{}b}".format(wrap(key).value, len(self.test)) -- 2.30.2