From: Sebastien Bourdeauducq Date: Sat, 23 Mar 2013 23:51:01 +0000 (+0100) Subject: genlib/record: use getattr instead of __dict__ X-Git-Tag: 24jan2021_ls180~2099^2~626 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3da98ea04d66da7d2193e9bd38801528ef526dfa;p=litex.git genlib/record: use getattr instead of __dict__ --- diff --git a/migen/genlib/record.py b/migen/genlib/record.py index 9ead8daa..adf9440b 100644 --- a/migen/genlib/record.py +++ b/migen/genlib/record.py @@ -34,7 +34,7 @@ class Record: def layout(self): l = [] for key, alignment in self.field_order: - e = self.__dict__[key] + e = getattr(self, key) if isinstance(e, Signal): l.append((key, (e.nbits, e.signed), alignment)) elif isinstance(e, Record): @@ -84,7 +84,7 @@ class Record: l.append(Replicate(0, pad_size)) offset += pad_size - e = self.__dict__[key] + e = getattr(self, key) if isinstance(e, Signal): added = [e] elif isinstance(e, Record):