Skip to content

Commit

Permalink
Fixes repeat real array bug where numbers were turned into strings
Browse files Browse the repository at this point in the history
  • Loading branch information
astroDimitrios committed Jan 16, 2025
1 parent 61ae825 commit 3704bd5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion metomi/rose/config_editor/valuewidget/array/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,14 @@ def setter(self, widget):
# Prevent str without "" breaking the underlying Python syntax
for e in self.entries:
v = e.get_text()
try:
float(v)
v_is_float = True
except:
v_is_float = False
if v in ("False", "True"): # Boolean
val_array.append(v)
elif (len(v) == 0) or (v[:1].isdigit()): # Empty or numeric
elif (len(v) == 0) or v_is_float: # Empty or numeric
val_array.append(v)
elif not v.startswith('"'): # Str - add in leading and trailing "
val_array.append('"' + v + '"')
Expand Down

0 comments on commit 3704bd5

Please sign in to comment.