Skip to content

Commit 9e29e3f

Browse files
authored
Fix --same-loops handling (#387)
* Fix --same-loops handling so it doesn't accumulate --loops arguments in the pyperf args. * Actually fix the bug now.
1 parent 56d12a8 commit 9e29e3f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pyperformance/run.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def run_benchmarks(should_run, python, options):
129129
run_count = str(len(to_run))
130130
errors = []
131131

132-
pyperf_opts = get_pyperf_opts(options)
132+
base_pyperf_opts = get_pyperf_opts(options)
133133

134134
import pyperf
135135
for index, bench in enumerate(to_run):
@@ -159,7 +159,9 @@ def add_bench(dest_suite, obj):
159159
return dest_suite
160160

161161
if name in loops:
162-
pyperf_opts.append(f"--loops={loops[name]}")
162+
pyperf_opts = [*base_pyperf_opts, f"--loops={loops[name]}"]
163+
else:
164+
pyperf_opts = base_pyperf_opts
163165

164166
bench_venv, bench_runid = benchmarks.get(bench)
165167
if bench_venv is None:

0 commit comments

Comments
 (0)