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:
becker33 2018-04-13 11:38:34 -07:00 committed by GitHub
parent 94fbd7b60d
commit b9c8cdcbe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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