Skip to content

Commit

Permalink
do not try to set constants from non scalar or list
Browse files Browse the repository at this point in the history
resolves #2212
  • Loading branch information
Fred Lefévère-Laoide authored and Fred Lefévère-Laoide committed Nov 18, 2024
1 parent 1668422 commit 3c42924
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions taipy/gui/builder/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ def visit_Name(self, node):
if var_parts[0] in self.non_vars:
return node
value = _get_value_in_frame(self.frame, var_parts[0])
if callable(value):
return node
if len(var_parts) > 1:
value = attrgetter(var_parts[1])(value)
if not isinstance(value, (str, int, float, bool, list, tuple)):
# transform into constants only what can be (ie not callable or generator for example)
return node
return ast.Constant(value=value, kind=None)


Expand Down

0 comments on commit 3c42924

Please sign in to comment.