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.
This commit is contained in:
parent
94fbd7b60d
commit
b9c8cdcbe3
1 changed files with 1 additions and 1 deletions
|
@ -381,7 +381,7 @@ def _execute_extends(pkg):
|
||||||
# msg = 'Packages can extend at most one other package.'
|
# msg = 'Packages can extend at most one other package.'
|
||||||
# raise DirectiveError(directive, msg)
|
# raise DirectiveError(directive, msg)
|
||||||
|
|
||||||
when = kwargs.pop('when', pkg.name)
|
when = kwargs.get('when', pkg.name)
|
||||||
_depends_on(pkg, spec, when=when)
|
_depends_on(pkg, spec, when=when)
|
||||||
pkg.extendees[spec] = (Spec(spec), kwargs)
|
pkg.extendees[spec] = (Spec(spec), kwargs)
|
||||||
return _execute_extends
|
return _execute_extends
|
||||||
|
|
Loading…
Reference in a new issue