File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments