From db29d34b0710e4eceded138fb11528f610864cd7 Mon Sep 17 00:00:00 2001 From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Mon, 16 Dec 2024 22:51:41 +0800 Subject: [PATCH] fix bug --- pyperformance/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyperformance/run.py b/pyperformance/run.py index a810a62a..280f8b03 100644 --- a/pyperformance/run.py +++ b/pyperformance/run.py @@ -142,7 +142,7 @@ def run_benchmarks(should_run, python, options): executor_input = [(i+1, len(to_run), python, options, bench) for i, bench in enumerate(to_run[1:])] # It's fine to set a higher worker count, because this is IO-bound anyways. - with concurrent.futures.ProcessPoolExecutor(max_workers=len(to_run)-1) as executor: + with concurrent.futures.ProcessPoolExecutor(max_workers=max(1, len(to_run))) as executor: for bench, venv_root, venv, bench_runid, cons_output in executor.map(setup_single_venv, executor_input): if venv_root is not None: venvs.add(venv_root)