From bc92ff9d3cc1e4b4aadbd7728f52f2829178e699 Mon Sep 17 00:00:00 2001 From: Elrond Date: Thu, 18 Apr 2013 15:53:09 +0200 Subject: Start to use six for basestring. six allows us to smoothly get more forward compatible with py3. The idea is to change things over to use six, when/if we feel a need for it. --- mediagoblin/tools/routing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mediagoblin/tools/routing.py') diff --git a/mediagoblin/tools/routing.py b/mediagoblin/tools/routing.py index 791cd1e6..a15795fe 100644 --- a/mediagoblin/tools/routing.py +++ b/mediagoblin/tools/routing.py @@ -16,6 +16,7 @@ import logging +import six from werkzeug.routing import Map, Rule from mediagoblin.tools.common import import_component @@ -43,7 +44,7 @@ def endpoint_to_controller(rule): _log.debug('endpoint: {0} view_func: {1}'.format(endpoint, view_func)) # import the endpoint, or if it's already a callable, call that - if isinstance(view_func, basestring): + if isinstance(view_func, six.string_types): view_func = import_component(view_func) rule.gmg_controller = view_func -- cgit v1.2.3