From 70e436e932d001af2d7e56514d35982434a5c239 Mon Sep 17 00:00:00 2001 From: Stephen McDowell Date: Thu, 21 Mar 2019 03:08:29 -0700 Subject: prevent UnboundLocalError when sourcing files (#10950) Patch extracted from #7536 courtesy of @mgsternberg --- lib/spack/spack/util/environment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/spack/spack/util/environment.py b/lib/spack/spack/util/environment.py index c7ea4d67f4..1666f4711e 100644 --- a/lib/spack/spack/util/environment.py +++ b/lib/spack/spack/util/environment.py @@ -542,6 +542,7 @@ class EnvironmentModifications(object): 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 -- cgit v1.2.3-60-g2f50