compatibility with Python 2 and Python 3