Make this work with python 2 and python 3.