msgpack.unpack requires a readable stream

This commit is contained in:
Michael Himing 2022-02-21 09:15:49 +11:00
parent b5b04fb9d0
commit 4bd64885b4

View File

@ -497,6 +497,6 @@ void common_hal_msgpack_pack(mp_obj_t obj, mp_obj_t stream_obj, mp_obj_t default
} }
mp_obj_t common_hal_msgpack_unpack(mp_obj_t stream_obj, mp_obj_t ext_hook, bool use_list) { mp_obj_t common_hal_msgpack_unpack(mp_obj_t stream_obj, mp_obj_t ext_hook, bool use_list) {
msgpack_stream_t stream = get_stream(stream_obj, MP_STREAM_OP_WRITE); msgpack_stream_t stream = get_stream(stream_obj, MP_STREAM_OP_READ);
return unpack(&stream, ext_hook, use_list); return unpack(&stream, ext_hook, use_list);
} }