Skip to content

Commit 3ec38ab

Browse files
committed
Fix Python lint issue
1 parent f145608 commit 3ec38ab

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

clang/test/lit.cfg.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,24 +140,26 @@ def have_host_out_of_process_jit_feature_support():
140140

141141
return False
142142

143-
def have_host_jit_feature_support(feature_name):
143+
def run_clang_repl(feature_name):
144144
clang_repl_exe = lit.util.which("clang-repl", config.clang_tools_dir)
145145

146146
if not clang_repl_exe:
147147
return False
148148

149149
try:
150-
clang_repl_cmd = subprocess.Popen(
151-
[clang_repl_exe, "--host-supports-" + feature_name], stdout=subprocess.PIPE
152-
)
150+
clang_repl_cmd = subprocess.Popen([clang_repl_exe, args],
151+
stdout=subprocess.PIPE)
153152
except OSError:
154153
print("could not exec clang-repl")
155154
return False
156155

157156
clang_repl_out = clang_repl_cmd.stdout.read().decode("ascii")
158157
clang_repl_cmd.wait()
159158

160-
return "true" in clang_repl_out
159+
return clang_repl_out
160+
161+
def have_host_jit_feature_support(feature_name):
162+
return "true" in run_clang_repl("--host-supports-" + feature_name)
161163

162164
def have_host_clang_repl_cuda():
163165
clang_repl_exe = lit.util.which('clang-repl', config.clang_tools_dir)
@@ -192,9 +194,7 @@ def have_host_clang_repl_cuda():
192194
if have_host_clang_repl_cuda():
193195
config.available_features.add('host-supports-cuda')
194196
hosttriple = run_clang_repl("--host-jit-triple")
195-
config.substitutions.append(
196-
("%host-jit-triple", hosttriple.strip())
197-
)
197+
config.substitutions.append("%host-jit-triple", hosttriple.strip())
198198

199199
if have_host_out_of_process_jit_feature_support():
200200
config.available_features.add("host-supports-out-of-process-jit")

0 commit comments

Comments
 (0)