mirror of
https://github.com/pocketpy/pocketpy
synced 2026-08-05 13:47:11 +08:00
Update bindings.c
This commit is contained in:
parent
e144785436
commit
4816c4471b
@ -111,9 +111,7 @@ static bool mpack_write_dict_kv(py_Ref k, py_Ref v, void* ctx) {
|
|||||||
} else {
|
} else {
|
||||||
return TypeError("msgpack: key must be string or integer");
|
return TypeError("msgpack: key must be string or integer");
|
||||||
}
|
}
|
||||||
bool ok = py_to_mpack(v, writer);
|
return py_to_mpack(v, writer);
|
||||||
if(!ok) mpack_write_nil(writer);
|
|
||||||
return ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool py_to_mpack(py_Ref object, mpack_writer_t* writer) {
|
static bool py_to_mpack(py_Ref object, mpack_writer_t* writer) {
|
||||||
@ -154,7 +152,10 @@ static bool py_to_mpack(py_Ref object, mpack_writer_t* writer) {
|
|||||||
if(!ok) return false;
|
if(!ok) return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: return TypeError("msgpack: unsupported type '%t'", object->type);
|
default: {
|
||||||
|
mpack_write_nil(writer);
|
||||||
|
return TypeError("msgpack: unsupported type '%t'", object->type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user