From 7669e793224691a6cfb36a65a7d682dfe75735f5 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 24 Sep 2014 19:42:37 +0000 Subject: [PATCH] fix bug #1335472: pfreeze should pack main module as __main__ --- direct/src/showutil/pfreeze.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/direct/src/showutil/pfreeze.py b/direct/src/showutil/pfreeze.py index 20093cc26a..ca43c25703 100755 --- a/direct/src/showutil/pfreeze.py +++ b/direct/src/showutil/pfreeze.py @@ -102,15 +102,16 @@ elif bl.endswith('.exe'): basename = os.path.splitext(basename)[0] startfile = args[0] +startmod = startfile if startfile.endswith('.py') or startfile.endswith('.pyw') or \ startfile.endswith('.pyc') or startfile.endswith('.pyo'): - startfile = os.path.splitext(startfile)[0] + startmod = os.path.splitext(startfile)[0] compileToExe = False if outputType == 'dll': - freezer.addModule(startfile) + freezer.addModule(startmod, filename = startfile) else: - freezer.addModule(startfile, newName = '__main__') + freezer.addModule('__main__', filename = startfile) compileToExe = True freezer.done(compileToExe = compileToExe)