summaryrefslogtreecommitdiff
path: root/msgpack/_unpacker.pyx
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/_unpacker.pyx
parentd766820421c9c67972f899cf6333fbb00e595162 (diff)
downloadmsgpack-python-f0fd90a759f07bccfd36e4f9eac8c4b545fd47a4.tar.gz
Fix exception incompatibility.
Diffstat (limited to 'msgpack/_unpacker.pyx')
-rw-r--r--msgpack/_unpacker.pyx4
1 files changed, 1 insertions, 3 deletions
diff --git a/msgpack/_unpacker.pyx b/msgpack/_unpacker.pyx
index b83a6e4..aeda02a 100644
--- a/msgpack/_unpacker.pyx
+++ b/msgpack/_unpacker.pyx
@@ -113,10 +113,8 @@ def unpackb(object packed, object object_hook=None, object list_hook=None,
if off < buf_len:
raise ExtraData(obj, PyBytes_FromStringAndSize(buf+off, buf_len-off))
return obj
- elif ret < 0:
- raise ValueError("Unpack failed: error = %d" % (ret,))
else:
- raise UnpackValueError
+ raise UnpackValueError("Unpack failed: error = %d" % (ret,))
def unpack(object stream, object object_hook=None, object list_hook=None,