summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-10-15 22:27:30 -0700
committerLance Stout <lancestout@gmail.com>2012-10-15 22:27:30 -0700
commit77f2a339e1626501a1df388050f09342d7bbcd1d (patch)
tree7ea3d3889628bd2509797a7069de0560a2c6252c /sleekxmpp/xmlstream
parent7c485c6a8b25b97c7faa4abda6e82200bd09bcae (diff)
parent4190027a787f878b4ea07ddd24883bb9d1a94d6e (diff)
downloadslixmpp-77f2a339e1626501a1df388050f09342d7bbcd1d.tar.gz
slixmpp-77f2a339e1626501a1df388050f09342d7bbcd1d.tar.bz2
slixmpp-77f2a339e1626501a1df388050f09342d7bbcd1d.tar.xz
slixmpp-77f2a339e1626501a1df388050f09342d7bbcd1d.zip
Merge branch 'master' into develop
Diffstat (limited to 'sleekxmpp/xmlstream')
-rw-r--r--sleekxmpp/xmlstream/tostring.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/sleekxmpp/xmlstream/tostring.py b/sleekxmpp/xmlstream/tostring.py
index 0b73d8dc..08d7ad02 100644
--- a/sleekxmpp/xmlstream/tostring.py
+++ b/sleekxmpp/xmlstream/tostring.py
@@ -70,9 +70,10 @@ def tostring(xml=None, xmlns='', stream=None,
# Output the tag name and derived namespace of the element.
namespace = ''
- if top_level and tag_xmlns not in [default_ns, xmlns, stream_ns] \
- or not top_level and tag_xmlns != xmlns:
- namespace = ' xmlns="%s"' % tag_xmlns
+ if tag_xmlns:
+ if top_level and tag_xmlns not in [default_ns, xmlns, stream_ns] \
+ or not top_level and tag_xmlns != xmlns:
+ namespace = ' xmlns="%s"' % tag_xmlns
if stream and tag_xmlns in stream.namespace_map:
mapped_namespace = stream.namespace_map[tag_xmlns]
if mapped_namespace: