From c6e1a3eef05674d637570c39f25a799cec7ba187 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Thu, 8 Sep 2011 13:36:15 +0200 Subject: [PATCH] baserlib: Accept empty body in FillOpcode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: RenΓ© Nussbaumer <rn@google.com> --- lib/rapi/baserlib.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/rapi/baserlib.py b/lib/rapi/baserlib.py index deffd12d6..c76ece259 100644 --- a/lib/rapi/baserlib.py +++ b/lib/rapi/baserlib.py @@ -156,10 +156,13 @@ def FillOpcode(opcls, body, static, rename=None): @return: Opcode object """ - CheckType(body, dict, "Body contents") + if body is None: + params = {} + else: + CheckType(body, dict, "Body contents") - # Make copy to be modified - params = body.copy() + # Make copy to be modified + params = body.copy() if rename: for old, new in rename.items(): -- GitLab