mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-25 14:44:10 +00:00
python: Fix segmentation fault when default returns it's argument.
This commit is contained in:
parent
9e8261cbd9
commit
3aaf5f5a7a
2 changed files with 3 additions and 3 deletions
|
|
@ -118,9 +118,9 @@ cdef class Packer(object):
|
|||
for v in o:
|
||||
ret = self._pack(v, nest_limit-1)
|
||||
if ret != 0: break
|
||||
elif self._default is not None:
|
||||
elif self._default:
|
||||
o = self._default(o)
|
||||
ret = self._pack(o, nest_limit)
|
||||
ret = self._pack(o, nest_limit-1)
|
||||
else:
|
||||
raise TypeError("can't serialize %r" % (o,))
|
||||
return ret
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue