environments: fail gracefully on missing keys (#26378)
This commit is contained in:
parent
ba701a7cf8
commit
6a57aede57
@ -1619,7 +1619,14 @@ def all_specs(self):
|
||||
"""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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user