Fix implementation for Python3 (including PyPy)
Merge pull request #6 from rawler/master

Fix implementation for Python3 (including PyPy)