Fix batch creation of instances
authorThomas Thrainer <thomasth@google.com>
Mon, 5 Aug 2013 09:06:13 +0000 (11:06 +0200)
committerThomas Thrainer <thomasth@google.com>
Wed, 7 Aug 2013 09:09:08 +0000 (11:09 +0200)
During batch creation of instances the 'reason' field in opcodes is set
to None (but the field is present). This caused problems when adding a
reasons to the reason trail.

Setting the default value for the 'reason' field to the empty list fixes
this issue.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

lib/opcodes.py

index 8ba0f78..d7e90ba 100644 (file)
@@ -659,7 +659,7 @@ class OpCode(BaseOpCode):
      " for details"),
     (COMMENT_ATTR, None, ht.TMaybeString,
      "Comment describing the purpose of the opcode"),
-    (constants.OPCODE_REASON, None, ht.TMaybeList,
+    (constants.OPCODE_REASON, ht.EmptyList, ht.TMaybeList,
      "The reason trail, describing why the OpCode is executed"),
     ]
   OP_RESULT = None