diff --git a/homeassistant/components/spc.py b/homeassistant/components/spc.py index 10544b3ef53..9742bc25c63 100644 --- a/homeassistant/components/spc.py +++ b/homeassistant/components/spc.py @@ -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)) diff --git a/homeassistant/util/async_.py b/homeassistant/util/async_.py index ea8e5e3c874..5676a1d0844 100644 --- a/homeassistant/util/async_.py +++ b/homeassistant/util/async_.py @@ -5,14 +5,7 @@ import logging from asyncio import coroutines from asyncio.futures import Future -try: - # pylint: disable=ungrouped-imports - from asyncio import ensure_future -except ImportError: - # Python 3.4.3 and earlier has this as async - # pylint: disable=unused-import - from asyncio import async - ensure_future = async +from asyncio import ensure_future _LOGGER = logging.getLogger(__name__)