Fix test for python3 compatibility