From 6ae1997bffb3d75083fb5c720336d036b18b22ce Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Tue, 2 Aug 2022 12:18:40 +0530 Subject: [PATCH] fix(utils): Strip * from cmd via get_env_cmd --- bench/utils/bench.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bench/utils/bench.py b/bench/utils/bench.py index a3a0d140..98cfec2e 100644 --- a/bench/utils/bench.py +++ b/bench/utils/bench.py @@ -22,17 +22,18 @@ logger = logging.getLogger(bench.PROJECT_NAME) @lru_cache(maxsize=None) -def get_env_cmd(cmd, bench_path="."): +def get_env_cmd(cmd: str, bench_path: str = ".") -> str: # this supports envs' generated by patched virtualenv or venv (which may cause an extra 'local' folder to be created) existing_python_bins = glob( - os.path.abspath(os.path.join(bench_path, "env", "**", "bin", cmd)), recursive=True + os.path.join(bench_path, "env", "**", "bin", cmd), recursive=True ) if existing_python_bins: return existing_python_bins[0] - return os.path.abspath(os.path.join(bench_path, "env", "bin", cmd)) + cmd = cmd.strip("*") + return os.path.join(bench_path, "env", "bin", cmd) def get_venv_path(verbose=False, python="python3"):