Fix issue with setting subelements values with default langs.

This commit is contained in:
Lance Stout 2012-06-20 23:19:52 -07:00
parent 2a78570d65
commit 1ad171dfe5

View file

@ -1003,11 +1003,11 @@ class ElementBase(object):
last_xml = element last_xml = element
element = last_xml element = last_xml
if element.attrib.get('{%s}lang' % XML_NS, default_lang) != lang: if lang:
element = ET.Element(ename) if element.attrib.get('{%s}lang' % XML_NS, default_lang) != lang:
if lang: element = ET.Element(ename)
element.attrib['{%s}lang' % XML_NS] = lang element.attrib['{%s}lang' % XML_NS] = lang
parent.append(element) parent.append(element)
element.text = text element.text = text
return element return element