summaryrefslogtreecommitdiff
path: root/msgpack/fallback.py
diff options
context:
space:
mode:
authorINADA Naoki <inada-n@klab.com>2013-02-22 17:41:52 +0900
committerINADA Naoki <inada-n@klab.com>2013-02-22 17:41:52 +0900
commitf0fd90a759f07bccfd36e4f9eac8c4b545fd47a4 (patch)
treedc035064959c80a75f7499917580e46ddbe21b0c /msgpack/fallback.py
parentd766820421c9c67972f899cf6333fbb00e595162 (diff)
downloadmsgpack-python-f0fd90a759f07bccfd36e4f9eac8c4b545fd47a4.tar.gz
Fix exception incompatibility.
Diffstat (limited to 'msgpack/fallback.py')
-rw-r--r--msgpack/fallback.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/msgpack/fallback.py b/msgpack/fallback.py
index 8dae9a7..f893e1a 100644
--- a/msgpack/fallback.py
+++ b/msgpack/fallback.py
@@ -102,7 +102,10 @@ def unpackb(packed, object_hook=None, list_hook=None, use_list=True,
encoding=encoding, unicode_errors=unicode_errors,
object_pairs_hook=object_pairs_hook)
unpacker.feed(packed)
- ret = unpacker._fb_unpack()
+ try:
+ ret = unpacker._fb_unpack()
+ except OutOfData:
+ raise UnpackValueError("Data is not enough.")
if unpacker._fb_got_extradata():
raise ExtraData(ret, unpacker._fb_get_extradata())
return ret