gnu: glib: Fix CVE-2021-28153.
[jackhill/guix/guix.git] / gnu / packages / patches / quickswitch-fix-dmenu-check.patch
CommitLineData
37356e0b
IVB
1Fix check for dmenu (open file mode, dependency on which).
2
3See <https://github.com/proxypoke/quickswitch-for-i3/pull/24>.
4
5--- quickswitch-i3-2.2/quickswitch.py 2016-09-18 19:59:10.257765542 +0200
6+++ quickswitch-i3-2.2/quickswitch.py 2016-09-21 10:43:01.277577819 +0200
7@@ -24,9 +24,10 @@
8
9 import argparse
10 import subprocess
11-import os
12 import re
13
14+from distutils.spawn import find_executable
15+
16 try:
17 import i3
18 except ImportError:
19@@ -37,11 +38,8 @@
20
21 def check_dmenu():
22 '''Check if dmenu is available.'''
23- devnull = open(os.devnull)
24- retcode = subprocess.call(["which", "dmenu"],
25- stdout=devnull,
26- stderr=devnull)
27- return True if retcode == 0 else False
28+ executable = find_executable("dmenu")
29+ return executable != None
30
31
32 def dmenu(options, dmenu):