valid child type for Mix|MetaConfig
This commit is contained in:
@ -980,6 +980,8 @@ class KernelMixConfig(KernelGroupConfig):
|
||||
"should be config, not {}"
|
||||
).format(self.impl_type,
|
||||
type(child)))
|
||||
if not isinstance(child, (KernelConfig, KernelMixConfig)):
|
||||
raise TypeError(_("child must be a Config, MixConfig or MetaConfig"))
|
||||
if child.cfgimpl_get_meta() is not None:
|
||||
raise ValueError(_("child has already a {}config's").format(self.impl_type))
|
||||
child._impl_meta = weakref.ref(self)
|
||||
@ -1193,6 +1195,8 @@ class KernelMetaConfig(KernelMixConfig):
|
||||
"should be config, not {}"
|
||||
).format(self.impl_type,
|
||||
type(child)))
|
||||
if not isinstance(child, (KernelConfig, KernelMetaConfig)):
|
||||
raise TypeError(_("child must be a Config or MetaConfig"))
|
||||
if descr is None:
|
||||
descr = child.cfgimpl_get_description()
|
||||
elif descr is not child.cfgimpl_get_description():
|
||||
|
Reference in New Issue
Block a user