summaryrefslogtreecommitdiff
path: root/msgpack/_unpacker.pyx
diff options
context:
space:
mode:
authorINADA Naoki <songofacandy@gmail.com>2014-02-13 01:19:33 +0900
committerINADA Naoki <songofacandy@gmail.com>2014-02-13 01:19:33 +0900
commitf322ed4e1bc3b9243b187df31af1f2d72876b9b6 (patch)
treece030b07f18c8c09a5aaa354be7a172ac183f3a3 /msgpack/_unpacker.pyx
parent7973cce554b94f4418c258fb723820ae5fffdd26 (diff)
parent77046b839da20feb528d303c8858ab6f34013ce7 (diff)
downloadmsgpack-python-f322ed4e1bc3b9243b187df31af1f2d72876b9b6.tar.gz
Merge pull request #84 from wbolster/exception-type-cleanups
Always raise TypeError for wrong argument types
Diffstat (limited to 'msgpack/_unpacker.pyx')
-rw-r--r--msgpack/_unpacker.pyx4
1 files changed, 2 insertions, 2 deletions
diff --git a/msgpack/_unpacker.pyx b/msgpack/_unpacker.pyx
index a359507..732adef 100644
--- a/msgpack/_unpacker.pyx
+++ b/msgpack/_unpacker.pyx
@@ -52,7 +52,7 @@ cdef inline init_ctx(unpack_context *ctx,
ctx.user.object_hook = ctx.user.list_hook = <PyObject*>NULL
if object_hook is not None and object_pairs_hook is not None:
- raise ValueError("object_pairs_hook and object_hook are mutually exclusive.")
+ raise TypeError("object_pairs_hook and object_hook are mutually exclusive.")
if object_hook is not None:
if not PyCallable_Check(object_hook):
@@ -228,7 +228,7 @@ cdef class Unpacker(object):
if file_like:
self.file_like_read = file_like.read
if not PyCallable_Check(self.file_like_read):
- raise ValueError("`file_like.read` must be a callable.")
+ raise TypeError("`file_like.read` must be a callable.")
if not max_buffer_size:
max_buffer_size = INT_MAX
if read_size > max_buffer_size: