Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/alicevision/meshroom.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikko Rasa <tdb@tdb.fi>2021-07-18 12:09:00 +0300
committerMikko Rasa <tdb@tdb.fi>2021-07-18 12:09:00 +0300
commitb9a7174886d7a215818f382f9d5c05226f86a3ff (patch)
tree71235a3f9962d6adf123c17ae2275218e1893669 /setupInitScriptUnix.py
parentd312d635f0c827b3a3653641b74f760937473bd2 (diff)
Fix incompatibility with recent cx_Freeze
The run() function of the startup script now gets the main module name as a parameter.
Diffstat (limited to 'setupInitScriptUnix.py')
-rwxr-xr-xsetupInitScriptUnix.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/setupInitScriptUnix.py b/setupInitScriptUnix.py
index 049680d4..75e1844c 100755
--- a/setupInitScriptUnix.py
+++ b/setupInitScriptUnix.py
@@ -30,11 +30,14 @@ sys.frozen = True
sys.path = sys.path[:4]
-def run():
+def run(*args):
m = __import__("__main__")
importer = zipimport.zipimporter(os.path.dirname(os.__file__))
- name, ext = os.path.splitext(os.path.basename(os.path.normcase(FILE_NAME)))
- moduleName = "%s__main__" % name
+ if len(args) == 0:
+ name, ext = os.path.splitext(os.path.basename(os.path.normcase(FILE_NAME)))
+ moduleName = "%s__main__" % name
+ else:
+ moduleName = args[0]
code = importer.get_code(moduleName)
exec(code, m.__dict__)