Adds Py2/Py3 compatibility