summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2019-01-09 14:57:39 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2019-01-09 14:57:39 +0100
commit4b482477e295bac0a7e3777883579de3ece3d7e0 (patch)
treeeb85be9368d15c7266e1948456909a8aea28f0da
parentf7e4caadfe8f63b5aa14d9266e3c722e9ab4007a (diff)
downloadslixmpp-4b482477e295bac0a7e3777883579de3ece3d7e0.tar.gz
slixmpp-4b482477e295bac0a7e3777883579de3ece3d7e0.tar.bz2
slixmpp-4b482477e295bac0a7e3777883579de3ece3d7e0.tar.xz
slixmpp-4b482477e295bac0a7e3777883579de3ece3d7e0.zip
Split ns only once in fix_ns().
-rw-r--r--slixmpp/xmlstream/stanzabase.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/slixmpp/xmlstream/stanzabase.py b/slixmpp/xmlstream/stanzabase.py
index cebce374..1c000b69 100644
--- a/slixmpp/xmlstream/stanzabase.py
+++ b/slixmpp/xmlstream/stanzabase.py
@@ -177,8 +177,9 @@ def fix_ns(xpath, split=False, propagate_ns=True, default_ns=''):
if '}' in ns_block:
# Apply the found namespace to following elements
# that do not have namespaces.
- namespace = ns_block.split('}')[0]
- elements = ns_block.split('}')[1].split('/')
+ ns_block_split = ns_block.split('}')
+ namespace = ns_block_split[0]
+ elements = ns_block_split[1].split('/')
else:
# Apply the stanza's namespace to the following
# elements since no namespace was provided.