support of py-module in prestartup script

This commit is contained in:
bigcat88 2025-03-05 10:34:53 +02:00
parent 27706f37f6
commit 7908e3b2f2
No known key found for this signature in database
GPG Key ID: 1F0BF0EC3CF22721

View File

@ -818,6 +818,9 @@ if script_executed:
if sys.platform.startswith('win32'):
cmds = ['"' + sys.executable + '"', '"' + sys_argv[0] + '"'] + sys_argv[1:]
elif sys_argv[0].endswith("__main__.py"): # this is a python module
module_name = os.path.basename(os.path.dirname(sys_argv[0]))
cmds = [sys.executable, '-m', module_name] + sys_argv[1:]
else:
cmds = [sys.executable] + sys_argv