mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Bugfix windows have a other default loop now (#4195)
* Bugfix windows have a other default loop now * fix handling with 3.4.2 that not support ensure_future * make the same as ensure_future does * fix spell * fix lazy test
This commit is contained in:
@@ -352,8 +352,8 @@ def from_config_dict(config: Dict[str, Any],
|
||||
future.set_exception(exc)
|
||||
|
||||
# run task
|
||||
future = asyncio.Future()
|
||||
asyncio.Task(_async_init_from_config_dict(future), loop=hass.loop)
|
||||
future = asyncio.Future(loop=hass.loop)
|
||||
hass.loop.create_task(_async_init_from_config_dict(future))
|
||||
hass.loop.run_until_complete(future)
|
||||
|
||||
return future.result()
|
||||
@@ -452,8 +452,8 @@ def from_config_file(config_path: str,
|
||||
future.set_exception(exc)
|
||||
|
||||
# run task
|
||||
future = asyncio.Future()
|
||||
asyncio.Task(_async_init_from_config_file(future), loop=hass.loop)
|
||||
future = asyncio.Future(loop=hass.loop)
|
||||
hass.loop.create_task(_async_init_from_config_file(future))
|
||||
hass.loop.run_until_complete(future)
|
||||
|
||||
return future.result()
|
||||
|
||||
Reference in New Issue
Block a user