summaryrefslogtreecommitdiff
path: root/msgpack/_msgpack.pyx
diff options
context:
space:
mode:
authorINADA Naoki <songofacandy@gmail.com>2011-01-29 23:22:41 +0900
committerINADA Naoki <songofacandy@gmail.com>2011-01-29 23:22:41 +0900
commit3aaf5f5a7afb4d51e6384f87a3f70a4235b9afb5 (patch)
treeb5e54024508b81a128218d9545e2e42ff96373d0 /msgpack/_msgpack.pyx
parent9e8261cbd94ca146bdf2fa72c73a19468f96ca74 (diff)
downloadmsgpack-python-3aaf5f5a7afb4d51e6384f87a3f70a4235b9afb5.tar.gz
python: Fix segmentation fault when `default` returns it's argument.
Diffstat (limited to 'msgpack/_msgpack.pyx')
-rw-r--r--msgpack/_msgpack.pyx4
1 files changed, 2 insertions, 2 deletions
diff --git a/msgpack/_msgpack.pyx b/msgpack/_msgpack.pyx
index 4df0345..9a6c232 100644
--- a/msgpack/_msgpack.pyx
+++ b/msgpack/_msgpack.pyx
@@ -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