Commit 6ecb821c by Russell Jones Committed by benjaoming

Replace basestring with six.string_types

parent 1baf410f
......@@ -19,7 +19,7 @@ def register(PluginClass):
settings_form = getattr(PluginClass, 'settings_form', None)
if settings_form:
if isinstance(settings_form, basestring):
if isinstance(settings_form, six.string_types):
klassname = settings_form.split(".")[-1]
modulename = ".".join(settings_form.split(".")[:-1])
form_module = import_module(modulename)
......@@ -52,4 +52,4 @@ def get_sidebar():
return _sidebar
def get_settings_forms():
return _settings_forms
\ No newline at end of file
return _settings_forms
......@@ -58,7 +58,7 @@ def reverse(*args, **kwargs):
return the result of calling reverse._transform_url(reversed_url)
for every url in the wiki namespace.
"""
if isinstance(args[0], basestring) and args[0].startswith('wiki:'):
if isinstance(args[0], six.string_types) and args[0].startswith('wiki:'):
url_kwargs = kwargs.get('kwargs', {})
path = url_kwargs.get('path', False)
# If a path is supplied then discard the article_id
......
......@@ -44,7 +44,7 @@ class MacroPreprocessor(markdown.preprocessors.Preprocessor):
value = kwarg.group('value')
if value is None:
value = True
if isinstance(value, basestring):
if isinstance(value, six.string_types):
# If value is enclosed with ': Remove and remove escape sequences
if value.startswith(u"'") and len(value) > 2:
value = value[1:-1]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment