8000 Merge branch '0.2-maint' · twigtek/msgpack-python@96ed236 · GitHub
[go: up one dir, main page]

Skip to content

Commit 96ed236

Browse files
committed
Merge branch '0.2-maint'
2 parents 48d693c + c3da845 commit 96ed236

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

msgpack/_msgpack.pyx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,10 @@ cdef extern from "unpack.h":
217217
def unpackb(object packed, object object_hook=None, object list_hook=None,
218218
bint use_list=0, encoding=None, unicode_errors="strict",
219219
):
220+
"""Unpack packed_bytes to object. Returns an unpacked object.
221+
222+
Raises `ValueError` when `packed` contains extra bytes.
220223
"""
221-
Unpack packed_bytes to object. Returns an unpacked object."""
222224
cdef template_context ctx
223225
cdef size_t off = 0
224226
cdef int ret
@@ -268,14 +270,16 @@ def unpackb(object packed, object object_hook=None, object list_hook=None,
268270
def unpack(object stream, object object_hook=None, object list_hook=None,
269271
bint use_list=0, encoding=None, unicode_errors="strict",
270272
):
271-
"""
272-
unpack an object from stream.
273+
"""Unpack an object from `stream`.
274+
275+
Raises `ValueError` when `stream` has extra bytes.
273276
"""
274277
return unpackb(stream.read(), use_list=use_list,
275278
object_hook=object_hook, list_hook=list_hook,
276279
encoding=encoding, unicode_errors=unicode_errors,
277280
)
278281

282+
279283
cdef class Unpacker(object):
280284
"""
281285
Streaming unpacker.

0 commit comments

Comments
 (0)
0