Made 2d309a70 compatible with Python 3.