Make commit 0c8d409 compatible with Python 3.