Skip to content

Commit

Permalink
fix Python runtime parameters bug
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
  • Loading branch information
pac48 committed Dec 31, 2023
1 parent 2734b70 commit e98f4b5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class __{{struct_name}}:
{% if not struct_instance|length -%}
__map_type = __{{struct_name}}
def add_entry(self, name):
setattr(self, name, self.__map_type())
if not hasattr(self, name):
setattr(self, name, self.__map_type())
def get_entry(self, name):
return getattr(self, name, self.__map_type())
return getattr(self, name)
{% endif -%}

0 comments on commit e98f4b5

Please # to comment.