From 8340a98faef3aacd592667147052f9964d0e9378 Mon Sep 17 00:00:00 2001 From: Ben Landrum <8enlandrum@gmail.com> Date: Mon, 7 Oct 2024 12:49:46 -0700 Subject: [PATCH] made which() robust to binaries in cwd --- pygrgl/clicmd/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygrgl/clicmd/common.py b/pygrgl/clicmd/common.py index 4aac088..92e335e 100644 --- a/pygrgl/clicmd/common.py +++ b/pygrgl/clicmd/common.py @@ -11,7 +11,7 @@ def which(exe: str, required=False) -> Optional[str]: except subprocess.CalledProcessError: result = None if result is None: - for p in sys.path: + for p in [*sys.path, os.getcwd()]: p = os.path.join(p, exe) if os.path.isfile(p): result = p