Fix python 3 regression