From bb7ba305c03defee540cbbe2a2a272aaa8dc4ce4 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 16 Jan 2020 11:48:59 +0100 Subject: [PATCH] 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. --- autorandr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.39.5