[sobjects] unicode → six.text_type
authorJulien Cristau <julien.cristau@logilab.fr>
Mon, 05 Oct 2015 16:47:55 +0200
changeset 10770 c3ed65f23181
parent 10769 c45f4bcff3aa
child 10771 a688ef1a12eb
[sobjects] unicode → six.text_type
sobjects/services.py
--- a/sobjects/services.py	Mon Oct 05 16:28:07 2015 +0200
+++ b/sobjects/services.py	Mon Oct 05 16:47:55 2015 +0200
@@ -19,6 +19,8 @@
 
 import threading
 
+from six import text_type
+
 from yams.schema import role_name
 from cubicweb import ValidationError
 from cubicweb.server import Service
@@ -129,7 +131,7 @@
             qname = role_name('login', 'subject')
             raise ValidationError(None, {qname: errmsg % login})
 
-        if isinstance(password, unicode):
+        if isinstance(password, text_type):
             # password should *always* be utf8 encoded
             password = password.encode('UTF8')
         cwuserkwargs['login'] = login