Replace unicode() with six.u()

six.u(text)
A fake unicode literal. text should always be a normal string literal.
In Python 2, u() returns unicode, and in Python 3, a string.

Partial Implement: blueprint py33-support

Change-Id: I02849e540c1fbb1f8b02bcbfa4d9be4f60279926
This commit is contained in:
Kui Shi
2013-10-14 17:48:13 +08:00
parent 309cacd9c0
commit d0a3dc68ac

View File

@@ -35,7 +35,7 @@ def _get_opt_path(simple_params=[], **kwargs):
class User(base.Resource):
def __init__(self, manager, info, loaded=False):
_d = {unicode('user_id'): info}
_d = {six.u('user_id'): info}
super(User, self).__init__(manager, _d, loaded)
def __repr__(self):
@@ -59,7 +59,7 @@ class UserManager(base.Manager):
class Project(base.Resource):
def __init__(self, manager, info, loaded=False):
_d = {unicode('project_id'): info}
_d = {six.u('project_id'): info}
super(Project, self).__init__(manager, _d, loaded)
def __repr__(self):