summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/spec.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index e34f2b799d..6cf80754a1 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -1388,8 +1388,9 @@ class Spec(object):
dependent = dep_spec.parent
deptypes = dep_spec.deptypes
- # remove self from all dependents.
- del dependent._dependencies[self.name]
+ # remove self from all dependents, unless it is already removed
+ if self.name in dependent._dependencies:
+ del dependent._dependencies[self.name]
# add the replacement, unless it is already a dep of dependent.
if concrete.name not in dependent._dependencies: