From e98f4b523223737a23ee04b99857e2443c2b7334 Mon Sep 17 00:00:00 2001 From: Paul Gesel Date: Sun, 31 Dec 2023 18:34:19 -0500 Subject: [PATCH] fix Python runtime parameters bug Signed-off-by: Paul Gesel --- .../jinja_templates/python/declare_struct | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/python/declare_struct b/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/python/declare_struct index 9723f2e..4ee3ddc 100644 --- a/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/python/declare_struct +++ b/generate_parameter_library_py/generate_parameter_library_py/jinja_templates/python/declare_struct @@ -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 -%}