aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws/objectify.py
diff options
context:
space:
mode:
Diffstat (limited to 'gsxws/objectify.py')
-rw-r--r--gsxws/objectify.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gsxws/objectify.py b/gsxws/objectify.py
index 7803f43..dfcae79 100644
--- a/gsxws/objectify.py
+++ b/gsxws/objectify.py
@@ -112,7 +112,7 @@ class GsxElement(objectify.ObjectifiedElement):
# Work around lxml chomping leading zeros off of IMEI numbers
if name in STRING_TYPES:
- return unicode(result.text or '')
+ return str(result.text or '')
if isinstance(result, objectify.NumberElement):
return result.pyval
@@ -120,7 +120,7 @@ class GsxElement(objectify.ObjectifiedElement):
if isinstance(result, objectify.StringElement):
name = result.tag
result = result.text or ''
- result = unicode(result)
+ result = str(result)
if not result:
return
@@ -157,10 +157,10 @@ def parse(root, response):
lookup = objectify.ObjectifyElementClassLookup(tree_class=GsxElement)
parser.set_element_class_lookup(lookup)
- if isinstance(root, basestring) and os.path.exists(root):
+ if isinstance(root, str) and os.path.exists(root):
root = objectify.parse(root, parser)
else:
- root = objectify.fromstring(root, parser)
+ root = objectify.fromstring(root.encode(), parser)
return root.find('*//%s' % response)