Skip to content

Commit fb65284

Browse files
committed
benchmarks: fix run_smoke_bench after upgrading to python3
Need to decode result of `subprocess.check_output`
1 parent 1b85082 commit fb65284

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

benchmark/scripts/run_smoke_bench

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,12 @@ def report_code_size(opt_level, old_dir, new_dir, architecture, platform, output
307307

308308

309309
def get_codesize(filename):
310-
output = subprocess.check_output(["size", filename]).splitlines()
311-
header_line = output[0]
312-
data_line = output[1]
310+
output = subprocess.check_output(["size", filename])
311+
lines = output.decode('utf-8').splitlines()
312+
header_line = lines[0]
313+
data_line = lines[1]
313314
if header_line.find("__TEXT") != 0:
314-
sys.exit("unexpected output from size command:\n" + output)
315+
sys.exit("unexpected output from size command:\n" + lines)
315316
return int(data_line.split("\t")[0])
316317

317318

@@ -361,7 +362,8 @@ performance team (@eeckstein).
361362
<summary><strong>Hardware Overview</strong></summary>
362363
363364
"""
364-
po = subprocess.check_output(["system_profiler", "SPHardwareDataType"])
365+
output = subprocess.check_output(["system_profiler", "SPHardwareDataType"])
366+
po = output.decode('utf-8')
365367
for line in po.splitlines():
366368
selection = [
367369
"Model Name",

0 commit comments

Comments
 (0)