summaryrefslogtreecommitdiff
path: root/slixmpp/xmlstream
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-04-04 16:18:24 +0200
committermathieui <mathieui@mathieui.net>2021-06-28 21:01:18 +0200
commit9f01d368c008f8775a991ddf8226a15735bc8303 (patch)
tree1b7d25072417ccdf4041f14a3487d2b7b3aa5572 /slixmpp/xmlstream
parentef064299416c6818adabcb22adb3cff205e547a5 (diff)
downloadslixmpp-9f01d368c008f8775a991ddf8226a15735bc8303.tar.gz
slixmpp-9f01d368c008f8775a991ddf8226a15735bc8303.tar.bz2
slixmpp-9f01d368c008f8775a991ddf8226a15735bc8303.tar.xz
slixmpp-9f01d368c008f8775a991ddf8226a15735bc8303.zip
refactor: remove the now obsolete future_wrapper and asyncio-related module
Diffstat (limited to 'slixmpp/xmlstream')
-rw-r--r--slixmpp/xmlstream/asyncio.py22
-rw-r--r--slixmpp/xmlstream/xmlstream.py2
2 files changed, 1 insertions, 23 deletions
diff --git a/slixmpp/xmlstream/asyncio.py b/slixmpp/xmlstream/asyncio.py
deleted file mode 100644
index b42b366a..00000000
--- a/slixmpp/xmlstream/asyncio.py
+++ /dev/null
@@ -1,22 +0,0 @@
-"""
-asyncio-related utilities
-"""
-
-import asyncio
-from functools import wraps
-
-def future_wrapper(func):
- """
- Make sure the result of a function call is an asyncio.Future()
- object.
- """
- @wraps(func)
- def wrapper(*args, **kwargs):
- result = func(*args, **kwargs)
- if isinstance(result, asyncio.Future):
- return result
- future = asyncio.Future()
- future.set_result(result)
- return future
-
- return wrapper
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index 8d90abf8..45d814fd 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -27,11 +27,11 @@ import ssl
import weakref
import uuid
+import asyncio
from asyncio import iscoroutinefunction, wait, Future
from contextlib import contextmanager
import xml.etree.ElementTree as ET
-from slixmpp.xmlstream.asyncio import asyncio
from slixmpp.xmlstream import tostring
from slixmpp.xmlstream.stanzabase import StanzaBase, ElementBase
from slixmpp.xmlstream.resolver import resolve, default_resolver