returning inside a generator broke pyinstaller