Skip to content

Commit 894b0fe

Browse files
committed
fix an issue with pypy's benchmarks on python3
1 parent 8faf12f commit 894b0fe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mx.graalpython/mx_graalpython_python_benchmarks.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,19 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
405405
["hg", "up", "-C", self.VERSION], cwd=join(workdir, "benchmarks")
406406
)
407407

408-
# workaround for pypy's benchmarks script issue
408+
# workaround for pypy's benchmarks script issues
409409
with open(join(workdir, "benchmarks", "nullpython.py")) as f:
410410
content = f.read()
411411
content = content.replace("/usr/bin/python", "/usr/bin/env python")
412412
with open(join(workdir, "benchmarks", "nullpython.py"), "w") as f:
413413
f.write(content)
414414

415+
with open(join(workdir, "benchmarks", "benchmarks.py")) as f:
416+
content = f.read()
417+
content = content.replace('float(line.split(b" ")[0])', 'float(line.split()[0])')
418+
with open(join(workdir, "benchmarks", "benchmarks.py"), "w") as f:
419+
f.write(content)
420+
415421
vm.run(workdir, ["-m", "venv", join(workdir, vm_venv)])
416422

417423
json_file = f"{vm_venv}.json"

0 commit comments

Comments
 (0)