From e49b7e02b2150413d2e78db709277fae0887be46 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Mon, 2 Jun 2014 20:59:28 +0300 Subject: Use six.text_type instead of unicode(). I will be switch to use ``from __future__ import unicode_literals`` later. --- mediagoblin/plugins/oauth/tools.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mediagoblin/plugins/oauth/tools.py') diff --git a/mediagoblin/plugins/oauth/tools.py b/mediagoblin/plugins/oauth/tools.py index af0a3305..2053d5d4 100644 --- a/mediagoblin/plugins/oauth/tools.py +++ b/mediagoblin/plugins/oauth/tools.py @@ -23,6 +23,8 @@ from datetime import datetime from functools import wraps +import six + from mediagoblin.tools.response import json_response @@ -86,7 +88,7 @@ def create_token(client, user): def generate_identifier(): ''' Generates a ``uuid.uuid4()`` ''' - return unicode(uuid.uuid4()) + return six.text_type(uuid.uuid4()) def generate_token(): @@ -110,5 +112,5 @@ def generate_secret(): ''' # XXX: We might not want it to use bcrypt, since bcrypt takes its time to # generate the result. - return unicode(getrandbits(192)) + return six.text_type(getrandbits(192)) -- cgit v1.2.3