mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-11-01 10:00:54 +00:00
Fix double INCREF-ing when unpacking.
This commit is contained in:
parent
b0f42ca49e
commit
46fae3d893
2 changed files with 13 additions and 11 deletions
|
|
@ -173,7 +173,7 @@ cdef extern from "unpack.h":
|
|||
int template_execute(template_context* ctx, const_char_ptr data,
|
||||
size_t len, size_t* off)
|
||||
void template_init(template_context* ctx)
|
||||
PyObject* template_data(template_context* ctx)
|
||||
object template_data(template_context* ctx)
|
||||
|
||||
|
||||
def unpacks(object packed_bytes):
|
||||
|
|
@ -183,7 +183,7 @@ def unpacks(object packed_bytes):
|
|||
cdef size_t off = 0
|
||||
template_init(&ctx)
|
||||
template_execute(&ctx, p, len(packed_bytes), &off)
|
||||
return <object> template_data(&ctx)
|
||||
return template_data(&ctx)
|
||||
|
||||
def unpack(object stream):
|
||||
"""unpack from stream."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue