Skip to content

Commit

Permalink
Fix utf-8 check for non string values. #52
Browse files Browse the repository at this point in the history
  • Loading branch information
theyosh committed Nov 26, 2017
1 parent f120c06 commit 2d55db4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion terrariumConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ def __update_config(self,section,data):
if type(data[setting]) is list:
data[setting] = ','.join(data[setting])

self.__config.set(section, str(setting), str(data[setting].encode('utf-8')))
if isinstance(data[setting], basestring):
data[setting] = data[setting].encode('utf-8')

self.__config.set(section, str(setting), str(data[setting]))

return self.__save_config()

Expand Down

0 comments on commit 2d55db4

Please sign in to comment.