mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Proactor policy fix (#17066)
* Proactor policy fix * Backport Proactor policy for <py37
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
import concurrent.futures
|
||||
import threading
|
||||
import logging
|
||||
import sys
|
||||
from asyncio import coroutines
|
||||
from asyncio.events import AbstractEventLoop
|
||||
from asyncio.futures import Future
|
||||
@@ -23,10 +22,7 @@ except AttributeError:
|
||||
|
||||
def asyncio_run(main: Awaitable[_T], *, debug: bool = False) -> _T:
|
||||
"""Minimal re-implementation of asyncio.run (since 3.7)."""
|
||||
if sys.platform == 'win32':
|
||||
loop = asyncio.ProactorEventLoop()
|
||||
else:
|
||||
loop = asyncio.new_event_loop()
|
||||
loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
loop.set_debug(debug)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user