Make sure objects inherited from Dict are properly casted (or else Cython will complain and crash).

This commit is contained in:
Steeve Morin 2012-06-16 13:56:46 +03:00
parent 7a4af28fa1
commit 07506667c9

View file

@ -128,7 +128,7 @@ cdef class Packer(object):
if ret == 0:
ret = msgpack_pack_raw_body(&self.pk, rawval, len(o))
elif PyDict_Check(o):
d = o
d = <dict>o
ret = msgpack_pack_map(&self.pk, len(d))
if ret == 0:
for k,v in d.iteritems():