[py3k] bytes vs str
authorRémi Cardona <remi.cardona@logilab.fr>
Tue, 15 Sep 2015 15:28:20 +0200
changeset 10674 f0006bdd36e9
parent 10673 9924fd69bcba
child 10675 e0db937f5add
[py3k] bytes vs str
schema.py
--- a/schema.py	Tue Sep 15 15:08:04 2015 +0200
+++ b/schema.py	Tue Sep 15 15:28:20 2015 +0200
@@ -995,7 +995,7 @@
 
     etype_name_re = r'[A-Z][A-Za-z0-9]*[a-z]+[A-Za-z0-9]*$'
     def add_entity_type(self, edef):
-        edef.name = edef.name.encode()
+        edef.name = str(edef.name)
         edef.name = bw_normalize_etype(edef.name)
         if not re.match(self.etype_name_re, edef.name):
             raise BadSchemaDefinition(
@@ -1020,7 +1020,7 @@
             raise BadSchemaDefinition(
                 '%r is not a valid name for a relation type. It should be '
                 'lower cased' % rdef.name)
-        rdef.name = rdef.name.encode()
+        rdef.name = str(rdef.name)
         rschema = super(CubicWebSchema, self).add_relation_type(rdef)
         self._eid_index[rschema.eid] = rschema
         return rschema