Skip to content

Commit

Permalink
core: fixed an error when loading templates
Browse files Browse the repository at this point in the history
  • Loading branch information
alploskov committed Aug 6, 2022
1 parent 957f39a commit 3c72e38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion kithon/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,12 @@ def add_templ(self, name, template):
elif isinstance(template, dict):
for field, value in template.items():
keywords = [
'tmp', 'type', 'import_code',
'type', 'import_code',
'code', 'alt_name', 'ret_type',
'meta', 'decorate', 'args'
]
if field == 'tmp':
self.templates[name].update({'tmp': Template(value)})
if field in keywords:
self.templates[name].update({field: value})
else:
Expand Down
2 changes: 1 addition & 1 deletion kithon/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, env=None, tmp=None, name=None, parts=None, type=None, nl=1, o
self.tmp = env.templates[tmp].get('tmp', '')
else:
self.name = name or 'unknown'
self.tmp = Template(tmp)
self.tmp = Template(tmp or '')
self.parts = parts
self.type = type or 'None'
self.env = env
Expand Down

0 comments on commit 3c72e38

Please sign in to comment.