Use basestring instead of str and unicode
This commit is contained in:
parent
37a00a48a7
commit
504751424f
|
@ -454,7 +454,7 @@ class Core(component.Component):
|
||||||
"""Set the config with values from dictionary"""
|
"""Set the config with values from dictionary"""
|
||||||
# Load all the values into the configuration
|
# Load all the values into the configuration
|
||||||
for key in config.keys():
|
for key in config.keys():
|
||||||
if isinstance(config[key], unicode) or isinstance(config[key], str):
|
if isinstance(config[key], basestring):
|
||||||
config[key] = config[key].encode("utf8")
|
config[key] = config[key].encode("utf8")
|
||||||
self.config[key] = config[key]
|
self.config[key] = config[key]
|
||||||
|
|
||||||
|
|
|
@ -854,7 +854,7 @@ class WebApi(JSONComponent):
|
||||||
"""
|
"""
|
||||||
web_config = component.get("DelugeWeb").config
|
web_config = component.get("DelugeWeb").config
|
||||||
for key in config.keys():
|
for key in config.keys():
|
||||||
if isinstance(config[key], unicode) or isinstance(config[key], str):
|
if isinstance(config[key], basestring):
|
||||||
config[key] = config[key].encode("utf8")
|
config[key] = config[key].encode("utf8")
|
||||||
web_config[key] = config[key]
|
web_config[key] = config[key]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue