Make it work for Python2 and Python3