Skip to content

Commit

Permalink
BF: When value of a list param is a valid variable name, print it lit…
Browse files Browse the repository at this point in the history
…erally rather than enclosing in []
  • Loading branch information
Todd authored and Todd committed Mar 31, 2021
1 parent 49cf52e commit 92811dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions psychopy/experiment/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ def toList(val):
stripped = val.strip()
if utils.scriptTarget == "PsychoJS":
return py2js.expression2js(stripped)
elif utils.valid_var_re.fullmatch(stripped):
return "{}".format(stripped)
elif not ((stripped.startswith('(') and stripped.endswith(')')) \
or ((stripped.startswith('[') and stripped.endswith(']')))):
return "[{}]".format(stripped)
Expand Down

0 comments on commit 92811dc

Please sign in to comment.