!fix: windows installed script execution

This commit is contained in:
nom3ad 2024-01-03 00:06:05 +05:30 committed by Brian May
parent b0799f8752
commit 32fceefa76

View File

@ -210,7 +210,10 @@ class FirewallClient:
def __init__(self, method_name, sudo_pythonpath):
self.auto_nets = []
argvbase = ([sys.executable, sys.argv[0]] +
argv0 = sys.argv[0]
# if argv0 is a not python script, it shall be an executable.
# In windows it will be a .exe file and other platforms it will be a shebang script
argvbase = (([sys.executable, sys.argv[0]] if argv0.endswith('.py') else [argv0]) +
['-v'] * (helpers.verbose or 0) +
['--method', method_name] +
['--firewall'])