mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-06 17:59:52 +00:00
Add tests and bugfix.
This commit is contained in:
parent
cb78959678
commit
37c2ad63af
3 changed files with 25 additions and 5 deletions
|
|
@ -705,7 +705,8 @@ static inline int msgpack_pack_bin(msgpack_packer *x, size_t l)
|
|||
|
||||
static inline int msgpack_pack_raw_body(msgpack_packer* x, const void* b, size_t l)
|
||||
{
|
||||
msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
|
||||
if (l > 0) msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ static inline int unpack_callback_array_item(unpack_user* u, unsigned int curren
|
|||
static inline int unpack_callback_array_end(unpack_user* u, msgpack_unpack_object* c)
|
||||
{
|
||||
if (u->list_hook) {
|
||||
PyObject *new_c = PyObject_CallFunction(u->list_hook, "(O)", *c);
|
||||
PyObject *new_c = PyObject_CallFunctionObjArgs(u->list_hook, *c, NULL);
|
||||
if (!new_c)
|
||||
return -1;
|
||||
Py_DECREF(*c);
|
||||
|
|
@ -203,7 +203,7 @@ static inline int unpack_callback_map_item(unpack_user* u, unsigned int current,
|
|||
static inline int unpack_callback_map_end(unpack_user* u, msgpack_unpack_object* c)
|
||||
{
|
||||
if (u->object_hook) {
|
||||
PyObject *new_c = PyObject_CallFunction(u->object_hook, "(O)", *c);
|
||||
PyObject *new_c = PyObject_CallFunctionObjArgs(u->object_hook, *c, NULL);
|
||||
if (!new_c)
|
||||
return -1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue