diff --git a/lib/spack/spack/directives.py b/lib/spack/spack/directives.py index 1e2435eac2..eca984093d 100644 --- a/lib/spack/spack/directives.py +++ b/lib/spack/spack/directives.py @@ -381,7 +381,7 @@ def _execute_extends(pkg): # msg = 'Packages can extend at most one other package.' # raise DirectiveError(directive, msg) - when = kwargs.pop('when', pkg.name) + when = kwargs.get('when', pkg.name) _depends_on(pkg, spec, when=when) pkg.extendees[spec] = (Spec(spec), kwargs) return _execute_extends