File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff 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 ))
You can’t perform that action at this time.
0 commit comments