File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
crates/pet-windows-registry/src Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,9 @@ fn get_registry_pythons_from_key_for_company(
122
122
123
123
// Possible this is a conda install folder.
124
124
if is_conda_env ( & env_path) {
125
- conda_locator. find_and_report ( reporter, & env_path) ;
125
+ if let Some ( reporter) = reporter {
126
+ conda_locator. find_and_report ( reporter, & env_path) ;
127
+ }
126
128
continue ;
127
129
}
128
130
@@ -186,7 +188,9 @@ fn get_registry_pythons_from_key_for_company(
186
188
} )
187
189
. build ( ) ;
188
190
189
- reporter. report_environment ( & env) ;
191
+ if let Some ( reporter) = reporter {
192
+ reporter. report_environment ( & env) ;
193
+ }
190
194
environments. push ( env) ;
191
195
}
192
196
Err ( err) => {
Original file line number Diff line number Diff line change @@ -36,19 +36,23 @@ impl WindowsRegistry {
36
36
return Some ( result) ;
37
37
}
38
38
39
- let registry_result = get_registry_pythons ( & self . conda_locator , & reporter) ?;
40
- result. replace ( registry_result) ;
39
+ if let Some ( registry_result) = get_registry_pythons ( & self . conda_locator , & reporter) {
40
+ result. replace ( registry_result) ;
41
+ } else {
42
+ result. replace ( LocatorResult {
43
+ managers : vec ! [ ] ,
44
+ environments : vec ! [ ] ,
45
+ } ) ;
46
+ }
41
47
42
48
Some ( registry_result)
43
49
}
44
50
#[ cfg( windows) ]
45
51
fn clear ( & self ) {
46
52
use std:: sync:: atomic:: Ordering ;
47
53
48
- self . searched . store ( false , Ordering :: Relaxed ) ;
49
- if let Ok ( mut envs) = self . environments . write ( ) {
50
- envs. clear ( ) ;
51
- }
54
+ let mut search_result = self . search_result . lock ( ) . unwrap ( ) ;
55
+ search_result. take ( ) ;
52
56
}
53
57
}
54
58
You can’t perform that action at this time.
0 commit comments