Skip to content

Commit a8fbd2c

Browse files
authored
Merge pull request psychopy#7516 from TEParsons/dev-ff-prefs-json
FF: When loading prefs from JSON, we need to unstringify each param
2 parents d59cd04 + 7d07524 commit a8fbd2c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

psychopy/preferences/preferences.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,12 @@ def fromJSON(self, file):
368368
for key in section:
369369
# if given in the JSON, set value
370370
if key in params:
371-
section[key] = params[key]['val']
371+
try:
372+
# attempt to un-stringify
373+
section[key] = json.loads(params[key]['val'])
374+
except:
375+
# use as-is if this fails
376+
section[key] = params[key]['val']
372377

373378
@property
374379
def devices(self):

0 commit comments

Comments
 (0)