From f0fd90a759f07bccfd36e4f9eac8c4b545fd47a4 Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Fri, 22 Feb 2013 17:41:52 +0900 Subject: Fix exception incompatibility. --- msgpack/fallback.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'msgpack/fallback.py') 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 -- cgit v1.2.1