summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-07-05 22:28:38 +0200
committermathieui <mathieui@mathieui.net>2021-07-05 22:28:38 +0200
commited3bb878a75c84c2be74d1212226298967ee26e5 (patch)
treed8e3df7a4b3bade8527def170833ff0756ad3d06
parentf2d7e86fc7426d6bdda244a4f399c7930b5624cc (diff)
downloadslixmpp-ed3bb878a75c84c2be74d1212226298967ee26e5.tar.gz
slixmpp-ed3bb878a75c84c2be74d1212226298967ee26e5.tar.bz2
slixmpp-ed3bb878a75c84c2be74d1212226298967ee26e5.tar.xz
slixmpp-ed3bb878a75c84c2be74d1212226298967ee26e5.zip
handler: fix more types
-rw-r--r--slixmpp/xmlstream/handler/base.py3
-rw-r--r--slixmpp/xmlstream/handler/callback.py2
-rw-r--r--slixmpp/xmlstream/handler/coroutine_callback.py3
-rw-r--r--slixmpp/xmlstream/handler/waiter.py3
4 files changed, 6 insertions, 5 deletions
diff --git a/slixmpp/xmlstream/handler/base.py b/slixmpp/xmlstream/handler/base.py
index e1edb249..0bae5674 100644
--- a/slixmpp/xmlstream/handler/base.py
+++ b/slixmpp/xmlstream/handler/base.py
@@ -8,8 +8,9 @@ from __future__ import annotations
import weakref
from weakref import ReferenceType
-from typing import Optional, TYPE_CHECKING
+from typing import Optional, TYPE_CHECKING, Union
from slixmpp.xmlstream.matcher.base import MatcherBase
+from xml.etree.ElementTree import Element
if TYPE_CHECKING:
from slixmpp.xmlstream import XMLStream, StanzaBase
diff --git a/slixmpp/xmlstream/handler/callback.py b/slixmpp/xmlstream/handler/callback.py
index 5d792bf9..50dd4c66 100644
--- a/slixmpp/xmlstream/handler/callback.py
+++ b/slixmpp/xmlstream/handler/callback.py
@@ -45,13 +45,13 @@ class Callback(BaseHandler):
"""
_once: bool
_instream: bool
- _pointer: Callable[[StanzaBase], Any]
def __init__(self, name: str, matcher: MatcherBase,
pointer: Callable[[StanzaBase], Any],
once: bool = False, instream: bool = False,
stream: Optional[XMLStream] = None):
BaseHandler.__init__(self, name, matcher, stream)
+ self._pointer: Callable[[StanzaBase], Any] = pointer
self._pointer = pointer
self._once = once
self._instream = instream
diff --git a/slixmpp/xmlstream/handler/coroutine_callback.py b/slixmpp/xmlstream/handler/coroutine_callback.py
index d41cd7ba..524cca54 100644
--- a/slixmpp/xmlstream/handler/coroutine_callback.py
+++ b/slixmpp/xmlstream/handler/coroutine_callback.py
@@ -47,7 +47,6 @@ class CoroutineCallback(BaseHandler):
_once: bool
_instream: bool
- _pointer: CoroutineFunction
def __init__(self, name: str, matcher: MatcherBase,
pointer: CoroutineFunction, once: bool = False,
@@ -62,7 +61,7 @@ class CoroutineCallback(BaseHandler):
except Exception as e:
stanza.exception(e)
- self._pointer = pointer_wrapper
+ self._pointer: CoroutineFunction = pointer_wrapper
self._once = once
self._instream = instream
diff --git a/slixmpp/xmlstream/handler/waiter.py b/slixmpp/xmlstream/handler/waiter.py
index 684bd32f..dde49754 100644
--- a/slixmpp/xmlstream/handler/waiter.py
+++ b/slixmpp/xmlstream/handler/waiter.py
@@ -8,7 +8,8 @@ from __future__ import annotations
import logging
from asyncio import Event, wait_for, TimeoutError
-from typing import Optional, TYPE_CHECKING
+from typing import Optional, TYPE_CHECKING, Union
+from xml.etree.ElementTree import Element
import slixmpp
from slixmpp.xmlstream.stanzabase import StanzaBase