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,13 +129,12 @@ impl PythonEnvironment {
129129 return None ;
130130 }
131131
132- let mut sys_path = Vec :: new ( ) ;
133-
134132 #[ cfg( not( windows) ) ]
135133 let bin_dir = prefix. join ( "bin" ) ;
136134 #[ cfg( windows) ]
137135 let bin_dir = prefix. join ( "Scripts" ) ;
138136
137+ let mut sys_path = Vec :: new ( ) ;
139138 sys_path. push ( bin_dir) ; // Add bin/ or Scripts/
140139
141140 if let Some ( site_packages) = Self :: find_site_packages ( prefix) {
@@ -157,12 +156,13 @@ impl PythonEnvironment {
157156 Ok ( p) => p,
158157 Err ( _) => return None ,
159158 } ;
160- let mut sys_path = Vec :: new ( ) ;
161159
162160 // which() might return a path inside a bin/Scripts dir, or directly the executable
163161 // We need the prefix, which is usually two levels up from the executable in standard layouts
164162 let bin_dir = python_path. parent ( ) ?;
165163 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