mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Fix StrEnum backport return type issue (#60610)
This commit is contained in:
parent
56899d61fe
commit
6e3f522d4b
@ -8,7 +8,7 @@ from typing import Any
|
||||
class StrEnum(str, Enum):
|
||||
"""Partial backport of Python 3.11's StrEnum for our basic use cases."""
|
||||
|
||||
def __new__(cls, value: str, *args: Any, **kwargs: Any) -> StrEnum:
|
||||
def __new__(cls, value: str, *args: Any, **kwargs: Any): # type: ignore[no-untyped-def]
|
||||
"""Create a new StrEnum instance."""
|
||||
if not isinstance(value, str):
|
||||
raise TypeError(f"{value!r} is not a string")
|
||||
|
Loading…
x
Reference in New Issue
Block a user