Make output work on both Python2 and Python3