mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-25 06:56:28 +02:00
Fix incompatibility with recent cx_Freeze
The run() function of the startup script now gets the main module name as a parameter.
This commit is contained in:
parent
d312d635f0
commit
b9a7174886
1 changed files with 6 additions and 3 deletions
|
@ -30,11 +30,14 @@ sys.frozen = True
|
||||||
sys.path = sys.path[:4]
|
sys.path = sys.path[:4]
|
||||||
|
|
||||||
|
|
||||||
def run():
|
def run(*args):
|
||||||
m = __import__("__main__")
|
m = __import__("__main__")
|
||||||
importer = zipimport.zipimporter(os.path.dirname(os.__file__))
|
importer = zipimport.zipimporter(os.path.dirname(os.__file__))
|
||||||
|
if len(args) == 0:
|
||||||
name, ext = os.path.splitext(os.path.basename(os.path.normcase(FILE_NAME)))
|
name, ext = os.path.splitext(os.path.basename(os.path.normcase(FILE_NAME)))
|
||||||
moduleName = "%s__main__" % name
|
moduleName = "%s__main__" % name
|
||||||
|
else:
|
||||||
|
moduleName = args[0]
|
||||||
code = importer.get_code(moduleName)
|
code = importer.get_code(moduleName)
|
||||||
exec(code, m.__dict__)
|
exec(code, m.__dict__)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue