Fix crash in python 3 recently inserted.
Merge pull request #1667 from nouiz/fix_py3

Fix crash in python 3 recently inserted.