Make the library work with both Python 2 and Python 3.