sim: fix message debug formatting
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 8 Mar 2012 14:27:35 +0000 (15:27 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Thu, 8 Mar 2012 14:27:35 +0000 (15:27 +0100)
migen/sim/ipc.py

index ca59c4f793a9b86e5bc593819b3cd1d1c864f8d1..5d9f9eb685ea2647cfc50cdb953ea2349548322e 100644 (file)
@@ -15,12 +15,14 @@ class Message:
                        setattr(self, parameter[1], value)
        
        def __str__(self):
-               p = ""
+               p = []
                for parameter in self.parameters:
-                       p += parameter[1] + "=" + str(getattr(self, parameter[1]))
+                       p.append(parameter[1] + "=" + str(getattr(self, parameter[1])))
                if p:
-                       p = " " + p
-               return "<" + self.__class__.__name__ + p + ">"
+                       pf = " " + " ".join(p)
+               else:
+                       pf = ""
+               return "<" + self.__class__.__name__ + pf + ">"
 
 class MessageTick(Message):
        code = 0