mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-06 17:59:52 +00:00
pack raise MemoryError when realloc is failed.
This commit is contained in:
parent
4480227e06
commit
ed40c671da
1 changed files with 3 additions and 1 deletions
|
|
@ -179,7 +179,9 @@ cdef class Packer(object):
|
|||
cpdef pack(self, object obj):
|
||||
cdef int ret
|
||||
ret = self._pack(obj, DEFAULT_RECURSE_LIMIT)
|
||||
if ret:
|
||||
if ret == -1:
|
||||
raise MemoryError
|
||||
elif ret: # should not happen.
|
||||
raise TypeError
|
||||
buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
|
||||
self.pk.length = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue