Merge pull request #24 from encukou/py3-schemaelement
[Py3] schema: Decode schema elements to str when loading
This commit is contained in:
commit
1bd672f96b
|
@ -33,6 +33,7 @@ class SchemaElement:
|
|||
|
||||
schema_element_str
|
||||
String which contains the schema element description to be parsed.
|
||||
(Bytestrings are decoded using UTF-8)
|
||||
|
||||
Class attributes:
|
||||
|
||||
|
@ -47,6 +48,8 @@ class SchemaElement:
|
|||
}
|
||||
|
||||
def __init__(self,schema_element_str=None):
|
||||
if sys.version_info >= (3, 0) and isinstance(schema_element_str, bytes):
|
||||
schema_element_str = schema_element_str.decode('utf-8')
|
||||
if schema_element_str:
|
||||
l = split_tokens(schema_element_str,self.token_defaults)
|
||||
self.set_id(l[1])
|
||||
|
|
Loading…
Reference in New Issue