Skip to content

Commit

Permalink
Split up massively compound statement
Browse files Browse the repository at this point in the history
  • Loading branch information
maresb committed Oct 17, 2024
1 parent 12a763a commit 6107993
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions conda_lock/conda_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from contextlib import contextmanager
from typing import (
Any,
Dict,
Iterable,
Iterator,
Expand Down Expand Up @@ -260,14 +261,12 @@ def _get_pkgs_dirs(
args = [str(conda), "config", "--json", "list", "pkgs_dirs"]
elif method == "info":
args = [str(conda), "info", "--json"]
pkgs_dirs = [
pathlib.Path(d)
for d in json.loads(
extract_json_object(
subprocess.check_output(args, env=conda_env_override(platform)).decode()
)
)["pkgs_dirs"]
]
env = conda_env_override(platform)
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 = [pathlib.Path(d) for d in pkgs_dirs_list]
return pkgs_dirs


Expand Down

0 comments on commit 6107993

Please sign in to comment.