port to python 3.4