python: fixed TypeError on some python version
Merge pull request #547 from shaitan/master

python: fixed TypeError on some python version