Use basestring instead of str and unicode

This commit is contained in:
John Garland 2010-07-02 15:19:42 +10:00
parent 37a00a48a7
commit 504751424f
2 changed files with 2 additions and 2 deletions

View File

@ -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]

View File

@ -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]