[schema] deal with py3k's string types

Related to #267910.

authorJulien Cristau <julien.cristau@logilab.fr>
changesetb2ab3ddbb5c4
branchdefault
phasedraft
hiddenyes
parent revision#e77969beafdc [reader] use six.moves to get at __builtin__ or builtins module
child revision#342166002939 [schema] implement __eq__ and __lt__ instead of __cmp__ for ERSchema
files modified by this revision
schema.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1413462762 -7200
# Thu Oct 16 14:32:42 2014 +0200
# Node ID b2ab3ddbb5c42bd4afe8de3f32365330a197b1c3
# Parent e77969beafdce4b481570faa5112418a81eff80c
[schema] deal with py3k's string types

Related to #267910.

diff --git a/schema.py b/schema.py
@@ -22,10 +22,12 @@
1  import warnings
2  from copy import deepcopy
3  from decimal import Decimal
4  from itertools import chain
5 
6 +from six import text_type
7 +
8  from logilab.common import attrdict
9  from logilab.common.decorators import cached, clear_cache
10  from logilab.common.interface import implements
11 
12  import yams
@@ -491,11 +493,11 @@
13          contains some invalid fields (ie some constraints failed)
14          """
15          if _ is not None:
16              warnings.warn('[yams 0.36] _ argument is deprecated, remove it',
17                            DeprecationWarning, stacklevel=2)
18 -        _ = unicode
19 +        _ = text_type
20          errors = {}
21          msgargs = {}
22          i18nvalues = []
23          relations = relations or self.subject_relations()
24          for rschema in relations: