Skip to content

Commit 51d527f

Browse files
authored
Merge pull request #45 from gogetdata/update_prefix_search
Update prefix base tracking
2 parents ccf18a4 + d88b76d commit 51d527f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ggd/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,6 @@ def prefix_in_conda(prefix):
703703
env_var_names[name] = env_path.rstrip("/")
704704
env_var_paths[env_path.rstrip("/")] = name
705705

706-
## Get the base/first conda environment
707-
cbase = min(env_var_paths.keys())
708-
709706
prefix = prefix.rstrip("/")
710707

711708
## Check that the file is in the environment lists
@@ -715,6 +712,9 @@ def prefix_in_conda(prefix):
715712
## Get the prefix path dd
716713
prefix_path = get_conda_prefix_path(prefix)
717714

715+
## Get the base/first conda environment for all environments that are subdirs of the specified prefix
716+
cbase = min([x for x in env_var_paths.keys() if x in prefix_path])
717+
718718
## Check that the file path includes the conda base directory
719719
if cbase not in prefix_path:
720720
raise CondaEnvironmentNotFound(prefix)

0 commit comments

Comments
 (0)