From 7c28f642b10100819b29b8cd345937e8e661add7 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 18 Apr 2019 17:06:33 +0000 Subject: [PATCH] hdl.xfrm: handle classes that inherit from Record. --- nmigen/hdl/xfrm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nmigen/hdl/xfrm.py b/nmigen/hdl/xfrm.py index 7c51a61..1385ce8 100644 --- a/nmigen/hdl/xfrm.py +++ b/nmigen/hdl/xfrm.py @@ -89,7 +89,8 @@ class ValueVisitor(metaclass=ABCMeta): new_value = self.on_AnySeq(value) elif type(value) is Signal: new_value = self.on_Signal(value) - elif type(value) is Record: + elif isinstance(value, Record): + # Uses `isinstance()` and not `type() is` to allow inheriting from Record. new_value = self.on_Record(value) elif type(value) is ClockSignal: new_value = self.on_ClockSignal(value) -- 2.30.2