From b9c8cdcbe3ac6009c005c4b9eeeb63c4461144bd Mon Sep 17 00:00:00 2001 From: becker33 Date: Fri, 13 Apr 2018 11:38:34 -0700 Subject: [PATCH] Fix when_spec inheritance for extensions (#7746) Popping the when spec from kwargs in the extends directive breaks class inheritance. Inheriting classes do not find their when spec. We now get the when spec from kwargs instead, leaving it to be found by any downstream package classes. --- lib/spack/spack/directives.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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