fluffychat: 1.22.1 -> 1.23.0 (#364091)
[NixPkgs.git] / pkgs / by-name / au / autorandr / 0001-don-t-use-sys.executable.patch
blob81879a8f834bcb63ff010c8e0b2ae587688ea042
1 From fdcc2f01441ec25104456022e6f8d3120709cede Mon Sep 17 00:00:00 2001
2 From: Romanos Skiadas <rom.skiad@gmail.com>
3 Date: Tue, 28 Jun 2022 06:16:10 +0300
4 Subject: [PATCH] don't use sys.executable
6 This is required for forking self in a nixpkgs environment,
7 where arandr might be wrapped. In that case, the actual arandr command
8 will be a bash script, not python.
9 There is no real reason to keep this around, nixpkgs properly sets the
10 interpreter in the shebang anyway.
11 ---
12 autorandr.py | 5 +----
13 1 file changed, 1 insertion(+), 4 deletions(-)
15 diff --git autorandr.py autorandr.py
16 index 35c15f6..1e84a2f 100755
17 --- a/autorandr.py
18 +++ b/autorandr.py
19 @@ -1192,10 +1192,7 @@ def dispatch_call_to_sessions(argv):
20 os.chdir(pwent.pw_dir)
21 os.environ.clear()
22 os.environ.update(process_environ)
23 - if sys.executable != "" and sys.executable != None:
24 - os.execl(sys.executable, sys.executable, autorandr_binary, *argv[1:])
25 - else:
26 - os.execl(autorandr_binary, autorandr_binary, *argv[1:])
27 + os.execl(autorandr_binary, autorandr_binary, *argv[1:])
28 sys.exit(1)
29 os.waitpid(child_pid, 0)
31 --
32 2.36.1