Skip to content

Commit bbfbe9d

Browse files
committed
fix: address linting errors
1 parent c55fbe0 commit bbfbe9d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/promptfoo/cli.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,14 @@ def _find_external_promptfoo() -> Optional[str]:
108108

109109
if argv0_path and promptfoo_path_norm == argv0_path:
110110
is_self = True
111-
elif sys.prefix != sys.base_prefix:
111+
elif (
112+
sys.prefix != sys.base_prefix
113+
and os.path.dirname(promptfoo_path_norm) == os.path.dirname(_normalize_path(sys.executable))
114+
):
112115
# Running in a virtual environment. Check if the found executable is in the same
113116
# directory as the Python interpreter. This detects shims (e.g. Windows .exe, uv)
114117
# where argv0 points to the script but shutil.which finds the shim.
115-
if os.path.dirname(promptfoo_path_norm) == os.path.dirname(_normalize_path(sys.executable)):
116-
is_self = True
118+
is_self = True
117119

118120
if is_self:
119121
wrapper_dir = _normalize_path(os.path.dirname(promptfoo_path))

0 commit comments

Comments
 (0)