Skip to content

Commit 030c84a

Browse files
committed
bm_2to3 now uses Runner.bench_command()
1 parent 98e9f05 commit 030c84a

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
import glob
22
import os.path
3-
import subprocess
43
import sys
54

65
import pyperf
76

87

9-
def bench_2to3(command, devnull_out):
10-
proc = subprocess.Popen(command,
11-
stdout=devnull_out,
12-
stderr=devnull_out)
13-
returncode = proc.wait()
14-
if returncode != 0:
15-
print("ERROR: 2to3 command failed!")
16-
sys.exit(1)
17-
18-
198
if __name__ == "__main__":
209
runner = pyperf.Runner()
2110

@@ -26,5 +15,4 @@ def bench_2to3(command, devnull_out):
2615
pyfiles = glob.glob(os.path.join(datadir, '*.py.txt'))
2716

2817
command = [sys.executable, "-m", "lib2to3", "-f", "all"] + pyfiles
29-
with open(os.devnull, "wb") as devnull_out:
30-
runner.bench_func('2to3', bench_2to3, command, devnull_out)
18+
runner.bench_command('2to3', command)

0 commit comments

Comments
 (0)