Skip to content

Commit

Permalink
Merge pull request #22 from rte-france/dev-Pascal
Browse files Browse the repository at this point in the history
fix name error when it's number
  • Loading branch information
Synx-FR authored Nov 30, 2021
2 parents 43b21e3 + 4be3c6f commit b04a1b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/scl_loader/scl_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ def __init__(self, datatypes: DataTypeTemplates, node_elem: etree.Element = None

self.name = self.name or self.tag

self.name = str(self.name)

if len(self.name) == 0:
raise AttributeError('Name cannot be set')

Expand Down Expand Up @@ -553,6 +555,8 @@ def _set_attributes_from_elem(self, node: etree.Element):
if node.text and len(node.text.strip()) > 0:
setattr(self, 'Val', _safe_convert_value(node.text))

self.name = str(self.name)

if len(self.name) == 0:
self.name = _get_node_name(node)

Expand Down

0 comments on commit b04a1b1

Please sign in to comment.