Skip to content

Commit ce041f1

Browse files
pvizeliballoob
authored andcommitted
Remove uvloop event policy (#29835)
* Remove uvloop event policy * Clean tests * Fix lint * Cleanup statment
1 parent 2fb36d3 commit ce041f1

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

homeassistant/__main__.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515

1616

1717
def set_loop() -> None:
18-
"""Attempt to use uvloop."""
18+
"""Attempt to use different loop."""
1919
import asyncio
2020
from asyncio.events import BaseDefaultEventLoopPolicy
2121

22-
policy = None
23-
2422
if sys.platform == "win32":
2523
if hasattr(asyncio, "WindowsProactorEventLoopPolicy"):
2624
# pylint: disable=no-member
@@ -33,15 +31,7 @@ class ProactorPolicy(BaseDefaultEventLoopPolicy):
3331
_loop_factory = asyncio.ProactorEventLoop
3432

3533
policy = ProactorPolicy()
36-
else:
37-
try:
38-
import uvloop
39-
except ImportError:
40-
pass
41-
else:
42-
policy = uvloop.EventLoopPolicy()
4334

44-
if policy is not None:
4535
asyncio.set_event_loop_policy(policy)
4636

4737

tests/conftest.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"""Set up some common test helper things."""
2-
import asyncio
32
import functools
43
import logging
5-
import os
64
from unittest.mock import patch
75

86
import pytest
@@ -26,10 +24,6 @@
2624
mock_aiohttp_client,
2725
) # noqa: E402 module level import not at top of file
2826

29-
if os.environ.get("UVLOOP") == "1":
30-
import uvloop
31-
32-
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
3327

3428
logging.basicConfig(level=logging.DEBUG)
3529
logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO)

0 commit comments

Comments
 (0)