Windows EXE: Fix CommandNotFoundException
Fixes CommandNotFoundException that occured when started from within a directory whose name contains a space.
This commit is contained in:
@@ -17,7 +17,7 @@ import subprocess
|
|||||||
def __main():
|
def __main():
|
||||||
with contextlib.suppress(AttributeError, psutil.Error):
|
with contextlib.suppress(AttributeError, psutil.Error):
|
||||||
if psutil.Process().parent().parent().name() == "explorer.exe":
|
if psutil.Process().parent().parent().name() == "explorer.exe":
|
||||||
subprocess.Popen("powershell -NoExit -Command \\\"& {0}\\\"".format(sys.argv[0]))
|
subprocess.Popen("powershell -NoExit -Command \\\"& '{0}'\\\"".format(sys.argv[0]))
|
||||||
return
|
return
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user