Make compatible with Python2/Python3.