Skip to content

Commit 9665e87

Browse files
committed
Adding empty dictionary for user prefs otherwhise is always None for the
Application
1 parent 841cca0 commit 9665e87

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

manatools/config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,17 @@ def _load(self) :
5252
try:
5353
f = os.path.join(loc, self._fileName)
5454
with open(f, 'r') as ymlfile:
55-
self._systemSettings = yaml.load(ymlfile)
55+
self._systemSettings = yaml.safe_load(ymlfile)
5656
break
5757
except IOError as e:
5858
print ("Skipped exception: <%s> " % str(e))
5959
pass
6060

6161
try:
6262
with open(self._userPrfesPathName, 'r') as ymlfile:
63-
self._userPrefs = yaml.load(ymlfile)
63+
self._userPrefs = yaml.safe_load(ymlfile)
64+
if not self._userPrefs:
65+
self._userPrefs = {}
6466
except IOError as e:
6567
print ("Skipped exception: <%s> " % str(e))
6668

0 commit comments

Comments
 (0)