From 504751424faec0255c0cfbf9f398a760fe63b0f6 Mon Sep 17 00:00:00 2001 From: John Garland Date: Fri, 2 Jul 2010 15:19:42 +1000 Subject: [PATCH] Use basestring instead of str and unicode --- deluge/core/core.py | 2 +- deluge/ui/web/json_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deluge/core/core.py b/deluge/core/core.py index 636d6b710..c9fcfd1e6 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -454,7 +454,7 @@ class Core(component.Component): """Set the config with values from dictionary""" # Load all the values into the configuration 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") self.config[key] = config[key] diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py index f917c8826..28bb75746 100644 --- a/deluge/ui/web/json_api.py +++ b/deluge/ui/web/json_api.py @@ -854,7 +854,7 @@ class WebApi(JSONComponent): """ web_config = component.get("DelugeWeb").config 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") web_config[key] = config[key]