From 77046b839da20feb528d303c8858ab6f34013ce7 Mon Sep 17 00:00:00 2001 From: Wouter Bolsterlee Date: Tue, 11 Feb 2014 20:34:23 +0100 Subject: 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). --- test/test_obj.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/test_obj.py') 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(): -- cgit v1.2.1