File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -129,12 +129,13 @@ impl PythonEnvironment {
129129 return None ;
130130 }
131131
132+ let mut sys_path = Vec :: new ( ) ;
133+
132134 #[ cfg( not( windows) ) ]
133135 let bin_dir = prefix. join ( "bin" ) ;
134136 #[ cfg( windows) ]
135137 let bin_dir = prefix. join ( "Scripts" ) ;
136138
137- let mut sys_path = Vec :: new ( ) ;
138139 sys_path. push ( bin_dir) ; // Add bin/ or Scripts/
139140
140141 if let Some ( site_packages) = Self :: find_site_packages ( prefix) {
@@ -156,13 +157,12 @@ impl PythonEnvironment {
156157 Ok ( p) => p,
157158 Err ( _) => return None ,
158159 } ;
160+ let mut sys_path = Vec :: new ( ) ;
159161
160162 // which() might return a path inside a bin/Scripts dir, or directly the executable
161163 // We need the prefix, which is usually two levels up from the executable in standard layouts
162164 let bin_dir = python_path. parent ( ) ?;
163165 let prefix = bin_dir. parent ( ) ?;
164-
165- let mut sys_path = Vec :: new ( ) ;
166166 sys_path. push ( bin_dir. to_path_buf ( ) ) ;
167167
168168 if let Some ( site_packages) = Self :: find_site_packages ( prefix) {
You can’t perform that action at this time.
0 commit comments