Skip to content

Commit edccebc

Browse files
committed
fix: keep try_from read-only (no registry walk) (PR #458)
1 parent e871689 commit edccebc

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • crates/pet-windows-registry/src

crates/pet-windows-registry/src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,14 @@ impl Locator for WindowsRegistry {
169169
// cache here would let a later `find(reporter)` short-circuit
170170
// on the cache hit and silently drop those conda
171171
// notifications (issue #454).
172-
if let Some((cached, _did_walk)) = self.find_with_cache(None) {
172+
let cached = {
173+
let result = self
174+
.search_result
175+
.lock()
176+
.expect("search_result mutex poisoned");
177+
result.as_ref().map(Arc::clone)
178+
};
179+
if let Some(cached) = cached {
173180
for found_env in &cached.result.environments {
174181
if let Some(ref python_executable_path) = found_env.executable {
175182
if python_executable_path == &env.executable {

0 commit comments

Comments
 (0)