Make Generator work in py3.