Be more lenient with spawning old, more free-form prototypes

This commit is contained in:
Griatch 2018-10-06 19:00:54 +02:00
parent dca73c707c
commit 7133492630
3 changed files with 46 additions and 11 deletions

View file

@ -659,6 +659,9 @@ def spawn(*prototypes, **kwargs):
# get available protparents
protparents = {prot['prototype_key'].lower(): prot for prot in protlib.search_prototype()}
if not kwargs.get("only_validate"):
prototypes = [protlib.homogenize_prototype(prot) for prot in prototypes]
# overload module's protparents with specifically given protparents
# we allow prototype_key to be the key of the protparent dict, to allow for module-level
# prototype imports. We need to insert prototype_key in this case