Skip to content

Commit 85a39ce

Browse files
author
ashuang
committed
emit_python generate valid code on empty LCM type
git-svn-id: https://lcm.googlecode.com/svn/trunk@520 989093bb-e83e-0410-a25a-9184cbcad8d0
1 parent f98bde2 commit 85a39ce

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lcmgen/emit_python.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,8 @@ static void
453453
emit_python_encode_one (const lcmgen_t *lcm, FILE *f, lcm_struct_t *ls)
454454
{
455455
emit(1, "def _encode_one(self, buf):");
456+
if(!g_ptr_array_size(ls->members))
457+
emit(2, "pass");
456458

457459
GQueue *struct_fmt = g_queue_new ();
458460
GQueue *struct_members = g_queue_new ();

0 commit comments

Comments
 (0)