summaryrefslogtreecommitdiff
path: root/msgpack/fallback.py
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2018-02-23 11:32:26 +0900
committerGitHub <noreply@github.com>2018-02-23 11:32:26 +0900
commit9455fccc5283abe59868c55ee3f4cedd5bf2d14b (patch)
tree3ad616bbba838c4c01e761dad4f5d6458e0e6b99 /msgpack/fallback.py
parent9bf38105f7dfd7e9885d8faee81c8bd188b4de4d (diff)
downloadmsgpack-python-9455fccc5283abe59868c55ee3f4cedd5bf2d14b.tar.gz
Revert "Move unpack() from each implementation to __init__. (#286)"
This reverts commit da902f9c1d996fb461f1efef6487ef40d32d365a.
Diffstat (limited to 'msgpack/fallback.py')
-rw-r--r--msgpack/fallback.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/msgpack/fallback.py b/msgpack/fallback.py
index 3609fd8..7e40686 100644
--- a/msgpack/fallback.py
+++ b/msgpack/fallback.py
@@ -100,6 +100,16 @@ def _get_data_from_buffer(obj):
return view
+def unpack(stream, **kwargs):
+ """
+ Unpack an object from `stream`.
+
+ Raises `ExtraData` when `packed` contains extra bytes.
+ See :class:`Unpacker` for options.
+ """
+ data = stream.read()
+ return unpackb(data, **kwargs)
+
def unpackb(packed, **kwargs):
"""