Modify Python version check
Apply 3to2
Manual fix for Python 2