summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbecker33 <becker33@llnl.gov>2018-04-13 11:38:34 -0700
committerGitHub <noreply@github.com>2018-04-13 11:38:34 -0700
commitb9c8cdcbe3ac6009c005c4b9eeeb63c4461144bd (patch)
treedbbe6831ad2880f142c38f23ffb7e6a351c43cb9
parent94fbd7b60d3610d4fdb6a4d55bca5158b6e1d29a (diff)
downloadspack-b9c8cdcbe3ac6009c005c4b9eeeb63c4461144bd.tar.gz
spack-b9c8cdcbe3ac6009c005c4b9eeeb63c4461144bd.tar.bz2
spack-b9c8cdcbe3ac6009c005c4b9eeeb63c4461144bd.tar.xz
spack-b9c8cdcbe3ac6009c005c4b9eeeb63c4461144bd.zip
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.
-rw-r--r--lib/spack/spack/directives.py2
1 files changed, 1 insertions, 1 deletions
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 extends(spec, **kwargs):
# 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