1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-05 12:52:19 +01:00

update minimal python version to 3.10 (#8850)

This commit is contained in:
Thomas Rupprecht
2025-05-22 03:21:43 +02:00
committed by GitHub
parent 026f47bfb3
commit aeb4e63950
36 changed files with 148 additions and 166 deletions

View File

@@ -42,14 +42,13 @@ Here everything is combined in `yield` expressions. You await other coroutines u
the last `yield` expression defines what is returned.
"""
import collections
from collections.abc import Awaitable, Generator, Iterator
from collections.abc import Awaitable, Callable, Generator, Iterator
import functools
import heapq
import inspect
import logging
import types
from typing import Any, Callable
from typing import Any
_LOGGER = logging.getLogger(__name__)
@@ -126,7 +125,7 @@ def _flatten_generator(gen: Generator[Any, Any, Any]):
ret = to_send if e.value is None else e.value
return ret
if isinstance(val, collections.abc.Awaitable):
if isinstance(val, Awaitable):
# yielded object that is awaitable (like `yield some_new_style_method()`)
# yield from __await__() like actual coroutines would.
to_send = yield from val.__await__()