summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/environment/environment.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/spack/spack/environment/environment.py b/lib/spack/spack/environment/environment.py
index 2536186b63..b275dd02f2 100644
--- a/lib/spack/spack/environment/environment.py
+++ b/lib/spack/spack/environment/environment.py
@@ -1619,7 +1619,14 @@ class Environment(object):
"""Return all specs, even those a user spec would shadow."""
all_specs = set()
for h in self.concretized_order:
- all_specs.update(self.specs_by_hash[h].traverse())
+ try:
+ spec = self.specs_by_hash[h]
+ except KeyError:
+ tty.warn(
+ 'Environment %s appears to be corrupt: missing spec '
+ '"%s"' % (self.name, h))
+ continue
+ all_specs.update(spec.traverse())
return sorted(all_specs)