From: Julian Grinblat Date: Tue, 23 Jun 2020 06:15:17 +0000 (+0900) Subject: Handle empty sys.executable X-Git-Tag: 1.11~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=df568a16223090cfef9f154845e72b7575dc6293;p=deb_pkgs%2Fautorandr.git Handle empty sys.executable --- 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)