Port to Python 2.7+ (i.e., ready for Python 3).