mirror of
				https://github.com/msgpack/msgpack-python.git
				synced 2025-10-31 09:30:53 +00:00 
			
		
		
		
	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:
		
							parent
							
								
									d5436c2819
								
							
						
					
					
						commit
						77046b839d
					
				
					 3 changed files with 10 additions and 10 deletions
				
			
		|  | @ -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(): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Wouter Bolsterlee
						Wouter Bolsterlee