Make clint.py portable across Python versions

Support both Python 2 and 3.