Commit f91f3e48 authored by Julien Muchembled's avatar Julien Muchembled

fixup! xml_marshaller: add support for Python 3

parent 598193ac
...@@ -596,11 +596,13 @@ class Unmarshaller(ElementTreeContentHandler): ...@@ -596,11 +596,13 @@ class Unmarshaller(ElementTreeContentHandler):
try: try:
value = klass(*initargs) value = klass(*initargs)
except TypeError as err: except TypeError as err:
reraise(TypeError, 'in constructor for %s: %s' % ( reraise(TypeError, TypeError('in constructor for %s: %s' % (
klass.__name__, err), sys.exc_info()[2]) klass.__name__, err)), sys.exc_info()[2])
# Now set the object's attributes from the marshalled dictionary # Now set the object's attributes from the marshalled dictionary
for k, v in kw.items(): for k, v in kw.items():
if not isinstance(k, str):
k = k.decode()
setattr(value, k, v) setattr(value, k, v)
self.data_stack[-5:] = [value] self.data_stack[-5:] = [value]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment