record: better exception code
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Mon, 9 Jan 2012 14:17:24 +0000 (15:17 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Mon, 9 Jan 2012 14:17:24 +0000 (15:17 +0100)
migen/corelogic/record.py

index 59b5cc2d884fb0a26ee64b499de9c9849fb9d684..e3862c340e7c438869a3e17d19d873c23250abdd 100644 (file)
@@ -42,8 +42,8 @@ class Record:
                        pos_fields = fields
                        for hop in path:
                                pos_self = getattr(pos_self, hop)
+                               lu = list(filter(lambda x: x[0] == hop, pos_fields))
                                try:
-                                       lu = list(filter(lambda x: x[0] == hop, pos_fields))
                                        pos_fields = lu[0][1]
                                except IndexError:
                                        n = []