Fix Windows loop (#16737)

* Fix Windows loop

* Fix windows Ctrl+C

* Move windows restart handler out of setup_and_run_hass
This commit is contained in:
Paulus Schoutsen 2018-09-22 09:54:37 +02:00 committed by GitHub
parent e9c7fe184d
commit 5613816476
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 22 deletions

View file

@ -129,10 +129,7 @@ class HomeAssistant:
self,
loop: Optional[asyncio.events.AbstractEventLoop] = None) -> None:
"""Initialize new Home Assistant object."""
if sys.platform == 'win32':
self.loop = loop or asyncio.ProactorEventLoop()
else:
self.loop = loop or asyncio.get_event_loop()
self.loop = loop or asyncio.get_event_loop()
executor_opts = {'max_workers': None} # type: Dict[str, Any]
if sys.version_info[:2] >= (3, 6):