Make sure things keep working in Python 4+

This changes ensures the project keeps working when Python 4 is released.