Modernizes Python code (fork with Python 2 and 3 support).