From df568a16223090cfef9f154845e72b7575dc6293 Mon Sep 17 00:00:00 2001 From: Julian Grinblat Date: Tue, 23 Jun 2020 15:15:17 +0900 Subject: [PATCH] Handle empty sys.executable --- autorandr.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autorandr.py b/autorandr.py index 824a7db..6b39928 100755 --- a/autorandr.py +++ b/autorandr.py @@ -1107,7 +1107,10 @@ def dispatch_call_to_sessions(argv): os.chdir(pwent.pw_dir) os.environ.clear() os.environ.update(process_environ) - os.execl(sys.executable, sys.executable, autorandr_binary, *argv[1:]) + if sys.executable != "": + os.execl(sys.executable, sys.executable, autorandr_binary, *argv[1:]) + else: + os.execl(autorandr_binary, autorandr_binary, *argv[1:]) os.exit(1) os.waitpid(child_pid, 0) -- 2.39.2