diff options
author | mathieui <mathieui@mathieui.net> | 2021-07-05 22:29:37 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-07-05 22:42:18 +0200 |
commit | af958fd1fe46d4a3f523ee3f4f103f15430b5fc2 (patch) | |
tree | 0b3f93b00544ba7dc6620a7aba271786db67f9fd /slixmpp/stanza/stream_error.py | |
parent | 0971bab30ae07d7ea11d9838e4149135e5fcb787 (diff) | |
download | slixmpp-af958fd1fe46d4a3f523ee3f4f103f15430b5fc2.tar.gz slixmpp-af958fd1fe46d4a3f523ee3f4f103f15430b5fc2.tar.bz2 slixmpp-af958fd1fe46d4a3f523ee3f4f103f15430b5fc2.tar.xz slixmpp-af958fd1fe46d4a3f523ee3f4f103f15430b5fc2.zip |
stanza: fix a bunch of type errors
Diffstat (limited to 'slixmpp/stanza/stream_error.py')
-rw-r--r-- | slixmpp/stanza/stream_error.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/slixmpp/stanza/stream_error.py b/slixmpp/stanza/stream_error.py index d2036a3c..d0eadd5b 100644 --- a/slixmpp/stanza/stream_error.py +++ b/slixmpp/stanza/stream_error.py @@ -4,7 +4,8 @@ # This file is part of Slixmpp. # See the file LICENSE for copying permission. from slixmpp.stanza.error import Error -from slixmpp.xmlstream import StanzaBase +from slixmpp.xmlstream import StanzaBase, ET +from typing import Optional, Dict, Union class StreamError(Error, StanzaBase): @@ -64,17 +65,18 @@ class StreamError(Error, StanzaBase): 'unsupported-version'} condition_ns: str = 'urn:ietf:params:xml:ns:xmpp-streams' - def get_see_other_host(self) -> str: + def get_see_other_host(self) -> Union[str, Dict[str, str]]: ns = self.condition_ns return self._get_sub_text('{%s}see-other-host' % ns, '') - def set_see_other_host(self, value: str) -> None: + def set_see_other_host(self, value: str) -> Optional[ET.Element]: if value: del self['condition'] ns = self.condition_ns return self._set_sub_text('{%s}see-other-host' % ns, value) elif self['condition'] == 'see-other-host': del self['condition'] + return None def del_see_other_host(self) -> None: self._del_sub('{%s}see-other-host' % self.condition_ns) |