check if node is already deleted (#2799)

* check if node is already deleted

* fix variable name
This commit is contained in:
Jason Sarich 2017-01-17 16:23:32 -06:00 committed by becker33
parent 190a5b575c
commit a1f7006400

View File

@ -1388,8 +1388,9 @@ def _replace_with(self, concrete):
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: