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).
This commit is contained in:
Wouter Bolsterlee 2014-02-11 20:34:23 +01:00
parent d5436c2819
commit 77046b839d
3 changed files with 10 additions and 10 deletions

View file

@ -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():