summaryrefslogtreecommitdiff
path: root/slixmpp/xmlstream/stanzabase.py
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2020-12-06 16:34:52 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2020-12-06 17:00:47 +0100
commitcd4c9f82fc8d17726baa4b4a69c54151fb181f40 (patch)
treed47b5d13b0d79f6526661bf23caebbef9c57d136 /slixmpp/xmlstream/stanzabase.py
parent05749c49690c00f2b1794212b2fb9281b6956a89 (diff)
downloadslixmpp-cd4c9f82fc8d17726baa4b4a69c54151fb181f40.tar.gz
slixmpp-cd4c9f82fc8d17726baa4b4a69c54151fb181f40.tar.bz2
slixmpp-cd4c9f82fc8d17726baa4b4a69c54151fb181f40.tar.xz
slixmpp-cd4c9f82fc8d17726baa4b4a69c54151fb181f40.zip
Remove OrderedDict usage
We now support only Python 3.7+, this means we can rely on dict being ordered by order of insertion, and thus no need to use OrderedDict from collections.
Diffstat (limited to 'slixmpp/xmlstream/stanzabase.py')
-rw-r--r--slixmpp/xmlstream/stanzabase.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/slixmpp/xmlstream/stanzabase.py b/slixmpp/xmlstream/stanzabase.py
index 925f2abc..141197ba 100644
--- a/slixmpp/xmlstream/stanzabase.py
+++ b/slixmpp/xmlstream/stanzabase.py
@@ -21,7 +21,6 @@ from xml.etree import ElementTree as ET
from slixmpp.xmlstream import JID
from slixmpp.xmlstream.tostring import tostring
-from collections import OrderedDict
log = logging.getLogger(__name__)
@@ -392,7 +391,7 @@ class ElementBase(object):
#: An ordered dictionary of plugin stanzas, mapped by their
#: :attr:`plugin_attrib` value.
- self.plugins = OrderedDict()
+ self.plugins = {}
self.loaded_plugins = set()
#: A list of child stanzas whose class is included in
@@ -541,7 +540,7 @@ class ElementBase(object):
.. versionadded:: 1.0-Beta1
"""
- values = OrderedDict()
+ values = {}
values['lang'] = self['lang']
for interface in self.interfaces:
if isinstance(self[interface], JID):
@@ -726,8 +725,6 @@ class ElementBase(object):
if lang and attrib in self.lang_interfaces:
kwargs['lang'] = lang
- kwargs = OrderedDict(kwargs)
-
if attrib in self.interfaces or attrib == 'lang':
if value is not None:
set_method = "set_%s" % attrib.lower()
@@ -813,8 +810,6 @@ class ElementBase(object):
if lang and attrib in self.lang_interfaces:
kwargs['lang'] = lang
- kwargs = OrderedDict(kwargs)
-
if attrib in self.interfaces or attrib == 'lang':
del_method = "del_%s" % attrib.lower()
@@ -929,7 +924,7 @@ class ElementBase(object):
name = self._fix_ns(name)
default_lang = self.get_lang()
- results = OrderedDict()
+ results = {}
stanzas = self.xml.findall(name)
if stanzas:
for stanza in stanzas: