From: Vincent Bernat Date: Thu, 16 Jan 2020 10:48:59 +0000 (+0100) Subject: Fork and exec using the current Python interpreter X-Git-Tag: 1.10~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=bb7ba305c03defee540cbbe2a2a272aaa8dc4ce4;p=deb_pkgs%2Fautorandr.git Fork and exec using the current Python interpreter When testing against various versions of Python by invoking autorandr with an explicit Python interpreter, in batch mode, autorandr will reexecute itself without specifying the Python interpreter. This change makes sure it is reexecuted using the current Python interpreter. --- diff --git a/autorandr.py b/autorandr.py index b781f4d..a6a9d2b 100755 --- a/autorandr.py +++ b/autorandr.py @@ -1084,7 +1084,7 @@ def dispatch_call_to_sessions(argv): os.chdir(pwent.pw_dir) os.environ.clear() os.environ.update(process_environ) - os.execl(autorandr_binary, autorandr_binary, *argv[1:]) + os.execl(sys.executable, sys.executable, autorandr_binary, *argv[1:]) os.exit(1) os.waitpid(child_pid, 0)