Update to support Python 2.7 and Python 3.2+