@@ -480,7 +480,7 @@ def _convert_list(self, list_node, id, name, ns):
480
480
self .logger .debug ("list: Parsing %s" % list_node )
481
481
for element in list_node :
482
482
if element .tag == ns + "value" :
483
- list .append (str (element .text ))
483
+ list .append (get_string (element .text ))
484
484
elif element .tag == ns + "ref" :
485
485
list .append (self ._convert_ref (element , "%s.list[%s]" % (name , len (list ))))
486
486
elif element .tag == ns + "object" :
@@ -502,7 +502,7 @@ def _convert_tuple(self, tuple_node, id, name, ns):
502
502
self .logger .debug ("tuple: Looking at %s" % element )
503
503
if element .tag == ns + "value" :
504
504
self .logger .debug ("tuple: Appending %s" % element .text )
505
- list .append (str (element .text ))
505
+ list .append (get_string (element .text ))
506
506
elif element .tag == ns + "ref" :
507
507
list .append (self ._convert_ref (element , "%s.tuple(%s}" % (name , len (list ))))
508
508
elif element .tag == ns + "object" :
@@ -523,7 +523,7 @@ def _convert_set(self, set_node, id, name, ns):
523
523
for element in set_node :
524
524
self .logger .debug ("Looking at element %s" % element )
525
525
if element .tag == ns + "value" :
526
- s .add (str (element .text ))
526
+ s .add (get_string (element .text ))
527
527
elif element .tag == ns + "ref" :
528
528
s .add (self ._convert_ref (element , name + ".set" ))
529
529
elif element .tag == ns + "object" :
@@ -566,14 +566,9 @@ def _convert_prop_def(self, comp, p, name, ns):
566
566
return self ._convert_ref (p .find (ns + "ref" ), name )
567
567
elif "value" in p .attrib or p .find (ns + "value" ) is not None :
568
568
if "value" in p .attrib :
569
- return ValueDef (name , str (p .get ("value" )))
569
+ return ValueDef (name , get_string (p .get ("value" )))
570
570
else :
571
- text = p .find (ns + "value" ).text
572
- try :
573
- text = str (text )
574
- except UnicodeEncodeError , e :
575
- text = unicode (text )
576
- return ValueDef (name , text )
571
+ return ValueDef (name , get_string (p .find (ns + "value" ).text ))
577
572
elif "dict" in p .attrib or p .find (ns + "dict" ) is not None :
578
573
if "dict" in p .attrib :
579
574
return self ._convert_dict (p .get ("dict" ), comp .get ("id" ), name , ns )
0 commit comments