Fix for python3

(the pull request is rolled back)