port to Python3.3