diff options
author | Wouter Bolsterlee <uws@xs4all.nl> | 2014-02-11 20:34:23 +0100 |
---|---|---|
committer | Wouter Bolsterlee <uws@xs4all.nl> | 2014-02-11 20:42:58 +0100 |
commit | 77046b839da20feb528d303c8858ab6f34013ce7 (patch) | |
tree | 1ee52a06c697ba160101a756bbf6a5f55af7c26c /test | |
parent | d5436c28197f3ccdd473e1c54838133574948dab (diff) | |
download | msgpack-python-77046b839da20feb528d303c8858ab6f34013ce7.tar.gz |
Always raise TypeError for wrong argument types
The code that checks whether hooks are callable() (and some other type
checks) should always raise TypeError on failure. Before this change,
both ValueError and TypeError were used in an inconsistent way (C
extension and Python implementation were not the same).
Diffstat (limited to 'test')
-rw-r--r-- | test/test_obj.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/test_obj.py b/test/test_obj.py index 9083218..390c1b6 100644 --- a/test/test_obj.py +++ b/test/test_obj.py @@ -31,7 +31,7 @@ def test_decode_pairs_hook(): assert unpacked[1] == prod_sum def test_only_one_obj_hook(): - with raises(ValueError): + with raises(TypeError): unpackb(b'', object_hook=lambda x: x, object_pairs_hook=lambda x: x) def test_bad_hook(): |