asyncio.ensure_future Python 3.5 (#13141)

This commit is contained in:
Otto Winter authored and GitHub committed 2018-03-12 19:42:08 +01:00
1 parent 9ee123f5ce
commit 890197e407
2 files changed
+2 -14

No files matched your search

+1 -6
View File
@@ -189,12 +189,7 @@ class SpcWebGateway:
def start_listener(self, async_callback, *args):
"""Start the websocket listener."""
try:
from asyncio import ensure_future
except ImportError:
from asyncio import async as ensure_future
ensure_future(self._ws_listen(async_callback, *args))
asyncio.ensure_future(self._ws_listen(async_callback, *args))
def _build_url(self, resource):
return urljoin(self._api_url, "spc/{}".format(resource))