Skip to content

Commit

Permalink
Handle either "pkgs_dirs" or "package cache" as the key
Browse files Browse the repository at this point in the history
This fixes the test.
  • Loading branch information
maresb committed Oct 17, 2024
1 parent 6107993 commit 0ae9316
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion conda_lock/conda_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,16 @@ def _get_pkgs_dirs(
output = subprocess.check_output(args, env=env).decode()
json_object_str = extract_json_object(output)
json_object: dict[str, Any] = json.loads(json_object_str)
pkgs_dirs_list: list[str] = json_object["pkgs_dirs"]
pkgs_dirs_list: list[str]
if "pkgs_dirs" in json_object:
pkgs_dirs_list = json_object["pkgs_dirs"]
elif "package cache" in json_object:
pkgs_dirs_list = json_object["package cache"]
else:
raise ValueError(
f"Unable to extract pkgs_dirs from {json_object}. "
"Please report this issue to the conda-lock developers."
)
pkgs_dirs = [pathlib.Path(d) for d in pkgs_dirs_list]
return pkgs_dirs

Expand Down

0 comments on commit 0ae9316

Please sign in to comment.