diff options
author | Lance Stout <lancestout@gmail.com> | 2012-06-20 23:19:52 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-06-20 23:19:52 -0700 |
commit | 1ad171dfe54238f4235de67d7fc3c7eb1d8ec3c0 (patch) | |
tree | 863b0b58d38fa8030645f2a95f35d653a3c2af64 | |
parent | 2a78570d6551cb5f85fb79083d9bdddf7f86b3d6 (diff) | |
download | slixmpp-1ad171dfe54238f4235de67d7fc3c7eb1d8ec3c0.tar.gz slixmpp-1ad171dfe54238f4235de67d7fc3c7eb1d8ec3c0.tar.bz2 slixmpp-1ad171dfe54238f4235de67d7fc3c7eb1d8ec3c0.tar.xz slixmpp-1ad171dfe54238f4235de67d7fc3c7eb1d8ec3c0.zip |
Fix issue with setting subelements values with default langs.
-rw-r--r-- | sleekxmpp/xmlstream/stanzabase.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py index 64e00626..88276ddf 100644 --- a/sleekxmpp/xmlstream/stanzabase.py +++ b/sleekxmpp/xmlstream/stanzabase.py @@ -1003,11 +1003,11 @@ class ElementBase(object): last_xml = element element = last_xml - if element.attrib.get('{%s}lang' % XML_NS, default_lang) != lang: - element = ET.Element(ename) - if lang: + if lang: + if element.attrib.get('{%s}lang' % XML_NS, default_lang) != lang: + element = ET.Element(ename) element.attrib['{%s}lang' % XML_NS] = lang - parent.append(element) + parent.append(element) element.text = text return element |