diff --git a/lib/spack/spack/util/environment.py b/lib/spack/spack/util/environment.py index c7ea4d67f40..1666f4711e3 100644 --- a/lib/spack/spack/util/environment.py +++ b/lib/spack/spack/util/environment.py @@ -542,6 +542,7 @@ def return_separator_if_any(*args): search = sep.join(after_list[start:end + 1]) except IndexError: env.prepend_path(x, after) + continue if search not in before: # We just need to set the variable to the new value