Make python_generator python 3 compatible.