From 6516b7b1786ed6eda9e7fbdd409b6edb4343677a Mon Sep 17 00:00:00 2001 From: Jason Paryani Date: Wed, 4 Sep 2013 21:57:52 -0700 Subject: [PATCH] Fix nested lists of structs for from_dict --- capnp/capnp.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/capnp/capnp.pyx b/capnp/capnp.pyx index 39bd0a5..76355b3 100644 --- a/capnp/capnp.pyx +++ b/capnp/capnp.pyx @@ -453,10 +453,10 @@ cdef _from_dict_helper(msg, field, d): for key, val in d.iteritems(): if key != 'which': _from_dict_helper(sub_msg, key, val) - elif d_type is list and not isinstance(d, basestring): + elif d_type is list: l = msg.init(field, len(d)) for i in range(len(d)): - if isinstance(d[i], dict): + if d_type is dict: for key, val in d[i].iteritems(): if key != 'which': _from_dict_helper(l[i], key, val)