From af958fd1fe46d4a3f523ee3f4f103f15430b5fc2 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 5 Jul 2021 22:29:37 +0200 Subject: stanza: fix a bunch of type errors --- slixmpp/stanza/stream_error.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'slixmpp/stanza/stream_error.py') 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) -- cgit v1.2.3