Fix #5 for Python 2.x
Reported by[ddao](https://github.com/ddao).